Skip to content

fix: log more #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/pgt_lsp/src/handlers/code_actions.rs
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ use pgt_workspace::features::code_actions::{
CodeActionKind, CodeActionsParams, CommandActionCategory, ExecuteStatementParams,
};

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

#[tracing::instrument(level = "debug", skip(session), err)]
pub async fn execute_command(
session: &Session,
params: ExecuteCommandParams,
6 changes: 1 addition & 5 deletions crates/pgt_lsp/src/handlers/completions.rs
Original file line number Diff line number Diff line change
@@ -3,11 +3,7 @@ use anyhow::Result;
use pgt_workspace::{WorkspaceError, features::completions::GetCompletionsParams};
use tower_lsp::lsp_types::{self, CompletionItem, CompletionItemLabelDetails};

#[tracing::instrument(level = "debug", skip_all, fields(
url = params.text_document_position.text_document.uri.as_str(),
character = params.text_document_position.position.character,
line = params.text_document_position.position.line
), err)]
#[tracing::instrument(level = "debug", skip(session), err)]
pub fn get_completions(
session: &Session,
params: lsp_types::CompletionParams,
15 changes: 3 additions & 12 deletions crates/pgt_lsp/src/handlers/text_document.rs
Original file line number Diff line number Diff line change
@@ -10,10 +10,7 @@ use tower_lsp::lsp_types;
use tracing::error;

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

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

/// Handler for `textDocument/didClose` LSP notification
#[tracing::instrument(level = "info", skip_all, fields(
url = params.text_document.uri.as_str(),
), err)]
#[tracing::instrument(level = "debug", skip(session), err)]
pub(crate) async fn did_close(
session: &Session,
params: lsp_types::DidCloseTextDocumentParams,
Loading