diff --git a/kclvm/sema/src/resolver/global.rs b/kclvm/sema/src/resolver/global.rs index 240a90f14..edde5f235 100644 --- a/kclvm/sema/src/resolver/global.rs +++ b/kclvm/sema/src/resolver/global.rs @@ -9,7 +9,6 @@ use crate::ty::{ }; use indexmap::IndexMap; use kclvm_ast::ast; -use kclvm_ast::walker::MutSelfTypedResultWalker; use kclvm_ast_pretty::{print_ast_node, print_schema_expr, ASTNode}; use kclvm_error::*; diff --git a/kclvm/tools/src/LSP/src/find_refs.rs b/kclvm/tools/src/LSP/src/find_refs.rs index 38e2db1ad..a2bd06b1a 100644 --- a/kclvm/tools/src/LSP/src/find_refs.rs +++ b/kclvm/tools/src/LSP/src/find_refs.rs @@ -16,9 +16,6 @@ pub(crate) fn find_refs Result<(), anyhow::Error>>( cursor_path: String, logger: F, ) -> anyhow::Result>> { - // todo: decide the scope by the workspace root and the kcl.mod both, use the narrower scope - // todo: should use the current file path - let mut ref_locations = vec![]; for (_, word_index) in word_index_map { diff --git a/kclvm/tools/src/LSP/src/main.rs b/kclvm/tools/src/LSP/src/main.rs index 62e576694..501bee468 100644 --- a/kclvm/tools/src/LSP/src/main.rs +++ b/kclvm/tools/src/LSP/src/main.rs @@ -1,7 +1,6 @@ use crate::main_loop::main_loop; use config::Config; use main_loop::app; -use std::collections::HashMap; mod analysis; mod capabilities; diff --git a/kclvm/tools/src/LSP/src/notification.rs b/kclvm/tools/src/LSP/src/notification.rs index a4a279ec3..3830968ad 100644 --- a/kclvm/tools/src/LSP/src/notification.rs +++ b/kclvm/tools/src/LSP/src/notification.rs @@ -101,23 +101,6 @@ impl LanguageServerState { word_index_add(value, new_word_index.clone()); } } - // let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - // let url = lsp_types::Url::from_file_path(root.clone()).unwrap(); - // let mm = self.word_index_map.get(&url).unwrap(); - // println!("word_index_map: {:?}", mm); - - // let file = from_lsp::file_path_from_url(&text_document.uri)?; - // let old_word_index = build_word_index_for_file_content(old_text, &text_document.uri); - // let new_word_index = build_word_index_for_file_content(text.clone(), &text_document.uri); - - // let file_path = Path::new(&text_document.uri.path()); - // for (key, mut value) in &self.word_index_map { - // let workspace_folder_path = Path::new(key.path()); - // if file_path.starts_with(workspace_folder_path) { - // value = &word_index_subtract(value, old_word_index.clone()); - // value = &word_index_add(value, new_word_index.clone()); - // } - // } Ok(()) }