From ad3d99f1c50fc241ddc38fcd337c3e6d74a382bf Mon Sep 17 00:00:00 2001 From: Owen Wu Date: Thu, 27 Oct 2022 21:41:46 +0800 Subject: [PATCH] feat: test skip public(script) warning --- .../editors/code/tests/lsp-demo/Move.toml | 6 +++--- language/move-analyzer/src/symbols.rs | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/language/move-analyzer/editors/code/tests/lsp-demo/Move.toml b/language/move-analyzer/editors/code/tests/lsp-demo/Move.toml index 47ddc67395..d9d9bd1261 100644 --- a/language/move-analyzer/editors/code/tests/lsp-demo/Move.toml +++ b/language/move-analyzer/editors/code/tests/lsp-demo/Move.toml @@ -2,8 +2,8 @@ name = "Symbols" version = "0.0.1" -[dependencies] -MoveStdlib = { local = "../../../../../../move-stdlib/", addr_subst = { "std" = "0x1" } } - [addresses] Symbols = "0xCAFE" + +[dependencies] +StarcoinFramework = {git = "https://github.com/starcoinorg/starcoin-framework.git", rev="cf1deda180af40a8b3e26c0c7b548c4c290cd7e7"} \ No newline at end of file diff --git a/language/move-analyzer/src/symbols.rs b/language/move-analyzer/src/symbols.rs index fe1a60a790..54bff7c037 100644 --- a/language/move-analyzer/src/symbols.rs +++ b/language/move-analyzer/src/symbols.rs @@ -690,7 +690,22 @@ impl Symbolicator { // start with empty diagnostics for all files and replace them with actual diagnostics // only for files that have failures/warnings so that diagnostics for all other files // (that no longer have failures/warnings) are reset - ide_diagnostics.extend(lsp_diagnostics); + for (key, value) in lsp_diagnostics { + let mut diags:Vec = vec![]; + + for diag in value { + if diag.message.contains("'public(script)' is deprecated") { // skip public(script) warning for starcoin chain + continue; + } + + diags.push(diag); + } + + if diags.len() > 0 { + ide_diagnostics.insert(key, diags); + } + } + if failure { // just return diagnostics as we don't have typed AST that we can use to compute // symbolication information