Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <18012015693@163.com>
  • Loading branch information
He1pa committed Nov 22, 2024
1 parent 3eab378 commit 4711178
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions kclvm/tools/src/LSP/src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pub fn completion(
// Complete builtin pkgs if in import stmt
completions.extend(completion_import_stmt(program, pos, metadata));
if !completions.is_empty() {
eprintln!("{:?}", "completion_import_stmt");
return Some(into_completion_items(&completions).into());
}

Expand Down
3 changes: 2 additions & 1 deletion kclvm/tools/src/LSP/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ pub(crate) fn handle_completion(
params: lsp_types::CompletionParams,
sender: Sender<Task>,
) -> anyhow::Result<Option<lsp_types::CompletionResponse>> {
eprintln!("{:?}", "handle_completion");
let file = file_path_from_url(&params.text_document_position.text_document.uri)?;
let path: VfsPath =
from_lsp::abs_path(&params.text_document_position.text_document.uri)?.into();
Expand Down Expand Up @@ -349,7 +350,7 @@ pub(crate) fn handle_completion(
.read()
.get(&workspace)
.and_then(|opt| opt.2.clone());

eprintln!("{:?}", "completion");
let res = completion(
completion_trigger_character,
&db.prog,
Expand Down
17 changes: 17 additions & 0 deletions kclvm/tools/src/LSP/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,16 @@ impl LanguageServerState {
opts.1.clone(),
);

eprintln!("{:?}", format!(
"Compile workspace: {:?}, main_pkg files: {:?}, changed file: {:?}, options: {:?}, metadate: {:?}, use {:?} micros",
workspace,
files,
filename,
opts.1,
opts.2,
start.elapsed().as_micros()
));

log_message(
format!(
"Compile workspace: {:?}, main_pkg files: {:?}, changed file: {:?}, options: {:?}, metadate: {:?}, use {:?} micros",
Expand Down Expand Up @@ -716,6 +726,9 @@ impl LanguageServerState {
match compile_res {
Ok((prog, schema_map, gs)) => {
let mut workspaces = snapshot.workspaces.write();
eprintln!("{:?}", format!(
"Workspace {:?} compile success",workspace
));
log_message(
format!(
"Workspace {:?} compile success",workspace
Expand All @@ -742,6 +755,10 @@ impl LanguageServerState {
}
}
Err(e) => {

eprintln!("{:?}", format!(
"Workspace {:?} compile failed: {:?}",workspace, e
));
let mut workspaces = snapshot.workspaces.write();
log_message(
format!(
Expand Down

0 comments on commit 4711178

Please sign in to comment.