diff --git a/crates/oxc_language_server/src/linter.rs b/crates/oxc_language_server/src/linter.rs index 0993d0e30..39d06ca38 100644 --- a/crates/oxc_language_server/src/linter.rs +++ b/crates/oxc_language_server/src/linter.rs @@ -1,3 +1,4 @@ +use log::debug; use std::{ fs, path::{Path, PathBuf}, @@ -291,6 +292,7 @@ impl IsolatedLintHandler { let not_supported_yet = source_type.as_ref().is_err_and(|_| !LINT_PARTIAL_LOADER_EXT.contains(&ext)); if not_supported_yet { + debug!("extension {ext} not supported yet."); return None; } let source_type = source_type.unwrap_or_default(); @@ -325,6 +327,8 @@ impl IsolatedLintHandler { let (source_text, source_type) = Self::may_need_extract_js_content(&source_text, ext) .unwrap_or((&source_text, source_type)); + debug!("lint {path:?}"); + let allocator = Allocator::default(); let ret = Parser::new(&allocator, source_text, source_type) .allow_return_outside_function(true) diff --git a/crates/oxc_language_server/src/main.rs b/crates/oxc_language_server/src/main.rs index 589a5dc25..23277e33a 100644 --- a/crates/oxc_language_server/src/main.rs +++ b/crates/oxc_language_server/src/main.rs @@ -191,10 +191,11 @@ impl LanguageServer for Backend { if run_level < SyntheticRunLevel::OnSave { return; } - if self.is_ignored(¶ms.text_document.uri).await { + let uri = params.text_document.uri; + if self.is_ignored(&uri).await { return; } - self.handle_file_update(params.text_document.uri, None, None).await; + self.handle_file_update(uri, None, None).await; } /// When the document changed, it may not be written to disk, so we should @@ -205,7 +206,9 @@ impl LanguageServer for Backend { return; } - if self.is_ignored(¶ms.text_document.uri).await { + let uri = ¶ms.text_document.uri; + if self.is_ignored(uri).await { + return; return; } let content = params.content_changes.first().map(|c| c.text.clone()); @@ -361,7 +364,11 @@ impl Backend { return false; }; let path = PathBuf::from(uri.path()); - gitignore_globs.matched_path_or_any_parents(&path, path.is_dir()).is_ignore() + let ignored = gitignore_globs.matched_path_or_any_parents(&path, path.is_dir()).is_ignore(); + if ignored { + debug!("ignored: {uri}"); + } + ignored } }