Skip to content

Commit 6872a6d

Browse files
committed
Add the file watcher and its test back
Signed-off-by: Siddhi Agrawal <[email protected]>
1 parent 543b906 commit 6872a6d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

kclvm/tools/src/LSP/src/state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ impl LanguageServerState {
208208
match e.kind {
209209
notify::EventKind::Modify(kind) => {
210210
if let notify::event::ModifyKind::Data(data_change) = kind {
211-
if let notify::event::DataChange::Content = data_change {
211+
if let notify::event::DataChange::Any = data_change {
212212
let paths = e.paths;
213213
let kcl_config_file: Vec<PathBuf> =
214214
filter_kcl_config_file(&paths);
215215
if !kcl_config_file.is_empty() {
216216
// TODO: wait for fix `kcl mod metadata` to read only. Otherwise it will lead to an infinite loop
217-
// return Some(Event::FileWatcher(
218-
// FileWatcherEvent::ChangedConfigFile(kcl_config_file),
219-
// ));
217+
return Some(Event::FileWatcher(
218+
FileWatcherEvent::ChangedConfigFile(kcl_config_file),
219+
));
220220
}
221221
}
222222
}

kclvm/tools/src/LSP/src/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,8 +1528,7 @@ fn complete_import_external_file_e2e_test() {
15281528
}
15291529

15301530
// TODO: wait for fix `kcl mod metadata` to read only. Otherwise it will lead to an infinite loop
1531-
#[allow(dead_code)]
1532-
// #[test]
1531+
#[test]
15331532
fn mod_file_watcher_test() {
15341533
let path = PathBuf::from(".")
15351534
.join("src")

0 commit comments

Comments
 (0)