forked from kcl-lang/kcl
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from kcl-lang:main #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
* enhance lsp diags. Change the return type of function `compile_with_params` from Result<(Program, IndexSet<Diagnostic>, GlobalState)> to (IndexSet<Diagnostic>, Result<(Program, GlobalState)>)). Returns the discovered diags when compilation fails. Signed-off-by: he1pa <18012015693@163.com> * fmt code Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
…d for the dependency update (#1375) Signed-off-by: peefy <xpf6677@163.com>
fix: fix lsp goto def of system pkg. refactor some unit test Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
Signed-off-by: peefy <xpf6677@163.com>
refactor: refactor lsp newline complete. Use gs scope kind replace program ast to judge whether in schema expr' Signed-off-by: he1pa <18012015693@163.com>
* feat: enhance upgrade dict to schema. handle union type of dict which value is scheam * remove `emit_error` in type_check Signed-off-by: he1pa <18012015693@163.com> * fix empty dict Signed-off-by: he1pa <18012015693@163.com> * fix ut absolute path Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
Signed-off-by: peefy <xpf6677@163.com>
* Refractored lambda_local_var_test Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com> * Refractored goto_def_test with snapshot testing Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com> * Fixed goto_local_var_def_tests Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com> --------- Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
* feat: api list_variables supports get variables from multi-files Signed-off-by: zongz <zongzhe1024@163.com> * fix: fix CR comments Signed-off-by: zongz <zongzhe1024@163.com> * fix: fix test cases Signed-off-by: zongz <zongzhe1024@163.com> --------- Signed-off-by: zongz <zongzhe1024@163.com>
feat: advanced resolver incremental compile. 1. Namer and Advanced Resolver support incremental compilation, clear cache by pkg and only update new pkg 2. Add gs cache in lsp state 3. Namer and Advanced Resolver modify gs in place(&mut) to reduce clone Signed-off-by: he1pa <18012015693@163.com>
…#1386) * feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> add function symbol kind to lsp Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update function symbol def Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fix ci Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fix ci Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> add tests to sema_token Signed-off-by: shruti2522 <shruti.apc01@gmail.com> add get_function_symbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> highlight for func call Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> modify walk_call_expr Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update namer for func_name Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: distinguish highlight for func symbol and normal var symbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update alloc_function_symbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> function symbol for builtin functions Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update function symbol def Signed-off-by: shruti2522 <shruti.apc01@gmail.com> delete test.log Signed-off-by: shruti2522 <shruti.apc01@gmail.com> remove func symbol from walk_call_expr Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update walk_call_expr for namer Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update sema test Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> add function symbol kind in global state Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update hover to handle func symbolkind Signed-off-by: shruti2522 <shruti.apc01@gmail.com> add condition for symbolkind in hover Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> remove print statements Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update loader snapshots Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fix advanced resolver Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update assign stmt for lambda expr Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update resolve_names for identifier_expr Signed-off-by: shruti2522 <shruti.apc01@gmail.com> update semantic tokens with function type Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: api list_variables supports get variables from multi-files (#1389) * feat: api list_variables supports get variables from multi-files Signed-off-by: zongz <zongzhe1024@163.com> * fix: fix CR comments Signed-off-by: zongz <zongzhe1024@163.com> * fix: fix test cases Signed-off-by: zongz <zongzhe1024@163.com> --------- Signed-off-by: zongz <zongzhe1024@163.com> feat: advance resolver incremental compile (#1209) feat: advanced resolver incremental compile. 1. Namer and Advanced Resolver support incremental compilation, clear cache by pkg and only update new pkg 2. Add gs cache in lsp state 3. Namer and Advanced Resolver modify gs in place(&mut) to reduce clone Signed-off-by: he1pa <18012015693@163.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> resolve conflicts Signed-off-by: shruti2522 <shruti.apc01@gmail.com> resolve conflicts Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> resolve conflicts Signed-off-by: shruti2522 <shruti.apc01@gmail.com> remove duplicate code Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> remove repititions Signed-off-by: shruti2522 <shruti.apc01@gmail.com> fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> feat: added FunctionSymbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * remove unwanted changes in global_state Signed-off-by: shruti2522 <shruti.apc01@gmail.com> remove unwanted changes in global_state Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * fmt check Signed-off-by: shruti2522 <shruti.apc01@gmail.com> --------- Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
remove incorrect code Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: Peefy <xpf6677@163.com>
Signed-off-by: peefy <xpf6677@163.com>
* feat: add completion item for string union types Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * feat: add completion items for string_union_types Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * remove unwanted code Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * conditional completion for str and str lit Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * add symbol complete items for string lit type Signed-off-by: shruti2522 <shruti.apc01@gmail.com> make fmt Signed-off-by: shruti2522 <shruti.apc01@gmail.com> add symbol complete items for string lit type Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * make fmt Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * conditional attrs for union types Signed-off-by: shruti2522 <shruti.apc01@gmail.com> make fmt Signed-off-by: shruti2522 <shruti.apc01@gmail.com> conditional attrs for union types Signed-off-by: shruti2522 <shruti.apc01@gmail.com> * add return value for union type to get_type_symbol Signed-off-by: shruti2522 <shruti.apc01@gmail.com> --------- Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
add completion tests for string union types make fmt add comments add completion tests for string union types update comment add completion tests for string union types Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
Signed-off-by: peefy <xpf6677@163.com>
* feat: automatic configuration merging is supported in ListVariables api Signed-off-by: zongz <zongzhe1024@163.com> * fix: add fmt for ListVariable api return code Signed-off-by: zongz <zongzhe1024@163.com> * fix: make fmt Signed-off-by: zongz <zongzhe1024@163.com> * fix: add more test cases Signed-off-by: zongz <zongzhe1024@163.com> * fix: rm useless comments Signed-off-by: zongz <zongzhe1024@163.com> --------- Signed-off-by: zongz <zongzhe1024@163.com>
#1419) feat: upgrade dict to schema for function parameters and return values Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: he1pa <18012015693@163.com>
* fix: allow setting PROTOC environment variable * fix: allow setting PROTOC environment variable
Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
Signed-off-by: Lan Liang <gcslyp@gmail.com>
Signed-off-by: peefy <xpf6677@163.com>
* fix: fix lsp parse cache. compile with vfs source code which not in main pkg Signed-off-by: he1pa <18012015693@163.com> * fix ut Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
* feat: program.pkg HashMap<String, Vec<Module>> -> HashMap<String, Vec<Arc<Module>>> . Reduce the performance loss of module ast clone Signed-off-by: he1pa <18012015693@163.com> * feat: use Arc<RwLock<Module>> in program to reduce deep copy when compiling Signed-off-by: he1pa <18012015693@163.com> * fix deep clone in evaluator Signed-off-by: he1pa <18012015693@163.com> * s/get_mut_module/get_module_mut Signed-off-by: he1pa <18012015693@163.com> * Refactor some duplicate code Signed-off-by: he1pa <18012015693@163.com> * replace std::Result with anyhow::Result Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
perf: Optimizing parser performance Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
Signed-off-by: peefy <xpf6677@163.com>
Signed-off-by: peefy <xpf6677@163.com>
* feat: lsp file watcher. Actively monitor file system changes. These changes will not be notified through lsp, e.g., execute `kcl mod add xxx`, `kcl fmt xxx` Signed-off-by: he1pa <18012015693@163.com> * s/FsEventWatcher/RecommendedWatcher Signed-off-by: he1pa <18012015693@163.com> * add lsp watcher ut Signed-off-by: he1pa <18012015693@163.com> * fix typo Signed-off-by: he1pa <18012015693@163.com> * fix ut Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
#1749) feat: Add a function to parse all kcl files in the given path and opts. Different from load_program, this function will compile files that are not imported. Signed-off-by: he1pa <18012015693@163.com>
fix: fix complete schema pkg name error. And optimize the cursor position after completion Signed-off-by: he1pa <18012015693@163.com>
* feat: lsp hint for config entry key type Signed-off-by: he1pa <18012015693@163.com> * update ut snapshot Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: peefy <xpf6677@163.com>
feat: add new api to get all schema under path Signed-off-by: he1pa <18012015693@163.com>
* feat: lsp complete for unimport schemas. Apply the new api load_all_files_under_paths to lsp, complete the unimport schemas, and complete the corresponding import schema_pkg Signed-off-by: he1pa <18012015693@163.com> * remove debug code Signed-off-by: he1pa <18012015693@163.com> * Merge duplicate completion items Signed-off-by: he1pa <18012015693@163.com> * only complete in root scope Signed-off-by: he1pa <18012015693@163.com> * move some test data file Signed-off-by: he1pa <18012015693@163.com> * filter schema in resolver, instead of advanced resolver. Do not analyze unimported pkg in AdvancedResolver to avoid extra performance loss Signed-off-by: he1pa <18012015693@163.com> * add ut Signed-off-by: he1pa <18012015693@163.com> * fix windows ut Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
* musl build for Alpine Linux Signed-off-by: utnim2 <mintugogoi567@gmail.com> * fixed the path name Signed-off-by: utnim2 <mintugogoi567@gmail.com> --------- Signed-off-by: utnim2 <mintugogoi567@gmail.com>
* feat: add service api GetSchemaTypeMappingUnderPath Signed-off-by: he1pa <18012015693@163.com> * fix typo Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: zongz <zongzhe1024@163.com>
Signed-off-by: zongz <zongzhe1024@163.com>
* fix: fix lsp watcher. remove feature, wait for `kcl mod metadata` to read only Signed-off-by: he1pa <18012015693@163.com> * add arg `--update` for `kcl mod metadata` Signed-off-by: he1pa <18012015693@163.com> * fix: fix native mod metadata Signed-off-by: zongz <zongzhe1024@163.com> * fix: make fmt Signed-off-by: zongz <zongzhe1024@163.com> * fix: rm git submodule Signed-off-by: zongz <zongzhe1024@163.com> * fix: rm git submodule Signed-off-by: zongz <zongzhe1024@163.com> * fix: rm git submodules Signed-off-by: zongz <zongzhe1024@163.com> --------- Signed-off-by: he1pa <18012015693@163.com> Signed-off-by: zongz <zongzhe1024@163.com> Co-authored-by: zongz <zongzhe1024@163.com>
fix func kcl_alloc. Init ptr value when alloc Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: zongz <zongzhe1024@163.com>
feat: Add some restrictions in load_all_files_under_paths to prevent performance issues Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: Sumitwarrior7 <sumitscience2017@gmail.com>
Signed-off-by: Peefy <xpf6677@163.com>
* feat: add chars method for builtin str Signed-off-by: Zejun Zhao <jelly.zhao.42@gmail.com> * fix ut Signed-off-by: he1pa <18012015693@163.com> * add unicode ut for chars() Signed-off-by: he1pa <18012015693@163.com> * fix ut Signed-off-by: He1pa <18012015693@163.com> --------- Signed-off-by: Zejun Zhao <jelly.zhao.42@gmail.com> Signed-off-by: he1pa <18012015693@163.com> Signed-off-by: He1pa <18012015693@163.com> Co-authored-by: he1pa <18012015693@163.com>
* fix: fix hidden global vars when merge in evaluator Signed-off-by: he1pa <18012015693@163.com> * add ut Signed-off-by: he1pa <18012015693@163.com> * fix `show_hidden` Signed-off-by: he1pa <18012015693@163.com> * fmt Signed-off-by: he1pa <18012015693@163.com> --------- Signed-off-by: he1pa <18012015693@163.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )