diff --git a/kclvm/tools/src/LSP/src/goto_def.rs b/kclvm/tools/src/LSP/src/goto_def.rs index af8e7ff24..a7b5a7dd9 100644 --- a/kclvm/tools/src/LSP/src/goto_def.rs +++ b/kclvm/tools/src/LSP/src/goto_def.rs @@ -302,14 +302,17 @@ pub(crate) fn resolve_var( let ty = get_system_member_function_ty(&name, &func_name); match &ty.kind { kclvm_sema::ty::TypeKind::Function(func_ty) => { - return Some(Definition::Object(ScopeObject { - name: func_name.clone(), - start: func_name_node.get_pos(), - end: func_name_node.get_end_pos(), - ty: ty.clone(), - kind: ScopeObjectKind::FunctionCall, - doc: Some(func_ty.doc.clone()), - }, func_name)) + return Some(Definition::Object( + ScopeObject { + name: func_name.clone(), + start: func_name_node.get_pos(), + end: func_name_node.get_end_pos(), + ty: ty.clone(), + kind: ScopeObjectKind::FunctionCall, + doc: Some(func_ty.doc.clone()), + }, + func_name, + )) } _ => return None, } diff --git a/kclvm/tools/src/LSP/src/request.rs b/kclvm/tools/src/LSP/src/request.rs index e694c74a3..1d4a3112d 100644 --- a/kclvm/tools/src/LSP/src/request.rs +++ b/kclvm/tools/src/LSP/src/request.rs @@ -44,7 +44,6 @@ impl LanguageServerState { state.shutdown_requested = true; Ok(()) })? - // .on::(handle_initialize)? .on::(handle_goto_definition)? .on::(handle_reference)? .on::(handle_completion)? diff --git a/kclvm/tools/src/LSP/src/util.rs b/kclvm/tools/src/LSP/src/util.rs index 45c7b3e23..53ab11618 100644 --- a/kclvm/tools/src/LSP/src/util.rs +++ b/kclvm/tools/src/LSP/src/util.rs @@ -754,7 +754,7 @@ pub fn build_word_index(path: String) -> anyhow::Result = text.lines().collect(); for (li, line) in lines.into_iter().enumerate() { let words = line_to_words(line.to_string());