-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lsp completion for internal pkg from program root (#1445)
Signed-off-by: he1pa <18012015693@163.com>
- Loading branch information
Showing
6 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...c/LSP/src/snapshots/kcl_language_server__completion__tests__import_internal_pkg_test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: tools/src/LSP/src/completion.rs | ||
expression: "format!(\"{:?}\",\n {\n let(file, program, _, gs) =\n compile_test_file(\"src/test_data/completion_test/import/internal/main.k\")\n ; let pos = KCLPos\n { filename : file.clone(), line : 1, column : Some(8), } ; let tool =\n toolchain :: default() ; let mut got =\n completion(None, & program, & pos, & gs, & tool).unwrap() ; match &\n mut got\n {\n CompletionResponse :: Array(arr) =>\n {\n let mut labels : Vec < String > =\n arr.iter().map(| item | item.label.clone()).collect() ;\n labels.sort() ; let labels : Vec < String > =\n labels.iter().filter(| label |!\n STANDARD_SYSTEM_MODULES.contains(&\n label.as_str())).cloned().collect() ; labels\n } CompletionResponse :: List(_) => panic! (\"test failed\"),\n }\n })" | ||
--- | ||
["tt"] |
File renamed without changes.
Empty file.
1 change: 1 addition & 0 deletions
1
kclvm/tools/src/LSP/src/test_data/completion_test/import/internal/main.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import |
Empty file.