Skip to content

Commit 893e36c

Browse files
cormacrelfdyc3ematipico
authored
fix(lsp): do not log full file contents twice on every keystroke (#8249)
Co-authored-by: Emanuele Stoppa <[email protected]> Co-authored-by: dyc3 <[email protected]> Co-authored-by: ematipico <[email protected]>
1 parent 2a229e4 commit 893e36c

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.changeset/shy-berries-poke.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Addressed [#7538](https://github.com/biomejs/biome/issues/7538). Reduced the
6+
volume of logging from the LSP server.
7+
8+
Use `biome clean` to remove large logs.

crates/biome_lsp/src/handlers/text_document.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use biome_service::workspace::{
1010
use camino::Utf8PathBuf;
1111
use std::sync::Arc;
1212
use tower_lsp_server::{UriExt, lsp_types};
13-
use tracing::{debug, error, field, info};
13+
use tracing::{debug, error, field, info, trace};
1414

1515
/// Handler for `textDocument/didOpen` LSP notification
1616
#[tracing::instrument(
@@ -164,17 +164,15 @@ pub(crate) async fn did_change(
164164
project_key: doc.project_key,
165165
path: path.clone(),
166166
})?;
167-
debug!("old document: {:?}", old_text);
168-
debug!("content changes: {:?}", params.content_changes);
167+
168+
trace!("content changes: {:?}", params.content_changes);
169169

170170
let text = apply_document_changes(
171171
session.position_encoding(),
172172
old_text,
173173
params.content_changes,
174174
);
175175

176-
debug!("new document: {:?}", text);
177-
178176
session.insert_document(url.clone(), Document::new(doc.project_key, version, &text));
179177

180178
session.workspace.change_file(ChangeFileParams {

0 commit comments

Comments
 (0)