Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <18012015693@163.com>
  • Loading branch information
He1pa committed Nov 7, 2024
1 parent e2f0ab3 commit 4f6d0ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ jobs:
- name: Unit test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/linux/kclvm/bin && make test
shell: bash
shell: bash
17 changes: 8 additions & 9 deletions kclvm/tools/src/LSP/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,13 @@ impl LanguageServerState {
if let Ok(e) = event {
match e.kind {
notify::EventKind::Modify(modify_kind) => {
if let notify::event::ModifyKind::Data(data_change) = modify_kind {
if let notify::event::DataChange::Content = data_change {
let paths = e.paths;
let kcl_config_file: Vec<PathBuf> = filter_kcl_config_file(&paths);
if !kcl_config_file.is_empty() {
return Some(Event::FileWatcher(
FileWatcherEvent::ChangedConfigFile(kcl_config_file),
));
}
if let notify::event::ModifyKind::Data(_) = modify_kind {
let paths = e.paths;
let kcl_config_file: Vec<PathBuf> = filter_kcl_config_file(&paths);
if !kcl_config_file.is_empty() {
return Some(Event::FileWatcher(
FileWatcherEvent::ChangedConfigFile(kcl_config_file),
));
}
}
}
Expand Down Expand Up @@ -644,6 +642,7 @@ impl LanguageServerState {
&mut files,
opts.1.clone(),
);

log_message(
format!(
"Compile workspace: {:?}, main_pkg files: {:?}, changed file: {:?}, options: {:?}, metadate: {:?}, use {:?} micros",
Expand Down
2 changes: 1 addition & 1 deletion kclvm/tools/src/LSP/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ fn mod_file_watcher_test() {
.unwrap();

// wait for download dependence
wait_async!(500);
wait_async!(1000);

server.notification::<lsp_types::notification::DidChangeTextDocument>(
lsp_types::DidChangeTextDocumentParams {
Expand Down

0 comments on commit 4f6d0ec

Please sign in to comment.