mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
chore(vscode): add some debug logs
This commit is contained in:
parent
42e7557f63
commit
0c5645097d
2 changed files with 15 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue