diff --git a/crates/sync-lsp/src/lib.rs b/crates/sync-lsp/src/lib.rs index d0c087d1..1b4bc129 100644 --- a/crates/sync-lsp/src/lib.rs +++ b/crates/sync-lsp/src/lib.rs @@ -297,7 +297,7 @@ impl LspClient { let mut req_queue = self.req_queue.lock(); let method = request.method.clone(); let req_id = request.id.clone(); - self.start_request(&req_id, &method, received_at); + self.start_request(&req_id, &method); req_queue.incoming.register(req_id, (method, received_at)); } @@ -378,8 +378,8 @@ impl LspClient { } impl LspClient { - fn start_request(&self, req_id: &RequestId, method: &str, received_at: Instant) { - log::info!("handling {method} - ({req_id}) at {received_at:0.2?}"); + fn start_request(&self, req_id: &RequestId, method: &str) { + log::info!("handling {method} - ({req_id})"); } fn stop_request(&self, req_id: &RequestId, method: &str, received_at: Instant) { @@ -387,16 +387,16 @@ impl LspClient { log::info!("handled {method} - ({req_id}) in {duration:0.2?}"); } - fn start_notification(&self, method: &str, received_at: Instant) { - log::info!("notifying {method} at {received_at:0.2?}"); + fn start_notification(&self, method: &str) { + log::info!("notifying {method}"); } fn stop_notification(&self, method: &str, received_at: Instant, result: LspResult<()>) { let request_duration = received_at.elapsed(); if let Err(err) = result { - log::error!("notifying {method} failed in {request_duration:0.2?}: {err:?}"); + log::error!("notify {method} failed in {request_duration:0.2?}: {err:?}"); } else { - log::info!("notifying {method} succeeded in {request_duration:0.2?}"); + log::info!("notify {method} succeeded in {request_duration:0.2?}"); } } } @@ -884,7 +884,7 @@ where /// Handles an incoming notification. fn on_notification(&mut self, received_at: Instant, not: Notification) -> anyhow::Result<()> { - self.client.start_notification(¬.method, received_at); + self.client.start_notification(¬.method); let handle = |s, Notification { method, params }: Notification| { let Some(handler) = self.notifications.get(method.as_str()) else { log::warn!("unhandled notification: {method}"); diff --git a/crates/tinymist-query/src/analysis.rs b/crates/tinymist-query/src/analysis.rs index 1bc27118..2d51e9f2 100644 --- a/crates/tinymist-query/src/analysis.rs +++ b/crates/tinymist-query/src/analysis.rs @@ -103,7 +103,7 @@ impl LspWorldExt for tinymist_project::LspWorld { fn uri_for_id(&self, fid: FileId) -> Result { let res = path_res_to_url(self.path_for_id(fid)?); - log::info!("uri_for_id: {fid:?} -> {res:?}"); + crate::log_debug_ct!("uri_for_id: {fid:?} -> {res:?}"); res.map_err(|err| FileError::Other(Some(eco_format!("convert to url: {err:?}")))) } diff --git a/crates/tinymist/src/input.rs b/crates/tinymist/src/input.rs index 9d2d9c23..87667906 100644 --- a/crates/tinymist/src/input.rs +++ b/crates/tinymist/src/input.rs @@ -15,7 +15,7 @@ use crate::*; impl ServerState { /// Updates a set of source files. fn update_sources(&mut self, files: FileChangeSet) -> Result<()> { - log::info!("update source: {files:?}"); + log::trace!("update source: {files:?}"); let intr = Interrupt::Memory(MemoryEvent::Update(files.clone())); self.project.interrupt(intr); @@ -25,7 +25,7 @@ impl ServerState { /// Creates a new source file. pub fn create_source(&mut self, path: ImmutPath, content: String) -> Result<()> { - log::info!("create source: {path:?}"); + log::trace!("create source: {path:?}"); self.memory_changes .insert(path.clone(), Source::detached(content.clone())); @@ -40,7 +40,7 @@ impl ServerState { /// Removes a source file. pub fn remove_source(&mut self, path: ImmutPath) -> Result<()> { self.memory_changes.remove(&path); - log::info!("remove source: {path:?}"); + log::trace!("remove source: {path:?}"); // todo: is it safe to believe that the path is normalized? let files = FileChangeSet::new_removes(vec![path]); diff --git a/crates/tinymist/src/lsp.rs b/crates/tinymist/src/lsp.rs index 6358b044..12ae2631 100644 --- a/crates/tinymist/src/lsp.rs +++ b/crates/tinymist/src/lsp.rs @@ -80,7 +80,7 @@ impl ServerState { /// LSP Document Synchronization impl ServerState { pub(crate) fn did_open(&mut self, params: DidOpenTextDocumentParams) -> LspResult<()> { - log::info!("did open {:?}", params.text_document.uri); + log::info!("did open {}", params.text_document.uri); let path: ImmutPath = as_path_(params.text_document.uri).as_path().into(); let text = params.text_document.text; diff --git a/crates/tinymist/src/main.rs b/crates/tinymist/src/main.rs index 78dc13d5..430a854e 100644 --- a/crates/tinymist/src/main.rs +++ b/crates/tinymist/src/main.rs @@ -116,7 +116,7 @@ pub fn lsp_main(args: LspArgs) -> Result<()> { .map(|e| e.splitn(2, ":").map(|e| e.trim()).collect::>()) .collect::>(); log::info!("tinymist version information: {pairs:?}"); - log::info!("starting Language server: {args:#?}"); + log::info!("starting language server: {args:?}"); let is_replay = !args.mirror.replay.is_empty(); with_stdio_transport(args.mirror.clone(), |conn| {