Skip to content

Commit b978a5a

Browse files
authored
fix: log more (#309)
1 parent 48d14a3 commit b978a5a

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

crates/pgt_lsp/src/handlers/code_actions.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use pgt_workspace::features::code_actions::{
99
CodeActionKind, CodeActionsParams, CommandActionCategory, ExecuteStatementParams,
1010
};
1111

12+
#[tracing::instrument(level = "debug", skip(session), err)]
1213
pub fn get_actions(
1314
session: &Session,
1415
params: lsp_types::CodeActionParams,
@@ -71,6 +72,7 @@ pub fn command_id(command: &CommandActionCategory) -> String {
7172
}
7273
}
7374

75+
#[tracing::instrument(level = "debug", skip(session), err)]
7476
pub async fn execute_command(
7577
session: &Session,
7678
params: ExecuteCommandParams,

crates/pgt_lsp/src/handlers/completions.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ use anyhow::Result;
33
use pgt_workspace::{WorkspaceError, features::completions::GetCompletionsParams};
44
use tower_lsp::lsp_types::{self, CompletionItem, CompletionItemLabelDetails};
55

6-
#[tracing::instrument(level = "debug", skip_all, fields(
7-
url = params.text_document_position.text_document.uri.as_str(),
8-
character = params.text_document_position.position.character,
9-
line = params.text_document_position.position.line
10-
), err)]
6+
#[tracing::instrument(level = "debug", skip(session), err)]
117
pub fn get_completions(
128
session: &Session,
139
params: lsp_types::CompletionParams,

crates/pgt_lsp/src/handlers/text_document.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use tower_lsp::lsp_types;
1010
use tracing::error;
1111

1212
/// Handler for `textDocument/didOpen` LSP notification
13-
#[tracing::instrument(level = "info", skip_all, fields(
14-
url = params.text_document.uri.as_str(),
15-
version = params.text_document.version
16-
), err)]
13+
#[tracing::instrument(level = "debug", skip(session), err)]
1714
pub(crate) async fn did_open(
1815
session: &Session,
1916
params: lsp_types::DidOpenTextDocumentParams,
@@ -41,11 +38,7 @@ pub(crate) async fn did_open(
4138
}
4239

4340
// Handler for `textDocument/didChange` LSP notification
44-
#[tracing::instrument(level = "debug", skip_all, fields(
45-
uri = params.text_document.uri.as_str(),
46-
version = params.text_document.version,
47-
num_content_changes = params.content_changes.len()
48-
), err)]
41+
#[tracing::instrument(level = "debug", skip(session), err)]
4942
pub(crate) async fn did_change(
5043
session: &Session,
5144
params: lsp_types::DidChangeTextDocumentParams,
@@ -97,9 +90,7 @@ pub(crate) async fn did_change(
9790
}
9891

9992
/// Handler for `textDocument/didClose` LSP notification
100-
#[tracing::instrument(level = "info", skip_all, fields(
101-
url = params.text_document.uri.as_str(),
102-
), err)]
93+
#[tracing::instrument(level = "debug", skip(session), err)]
10394
pub(crate) async fn did_close(
10495
session: &Session,
10596
params: lsp_types::DidCloseTextDocumentParams,

0 commit comments

Comments
 (0)