lsp: Add server-side tracing support (#15230)

This PR adds another row to the LSP log view: Server traces

![image](https://github.com/user-attachments/assets/e3f77944-45e0-4d04-92fd-aea212859e86)


[Traces](https://docs.rs/lsp-types/latest/lsp_types/notification/enum.LogTrace.html)
are intended for logging execution diagnostics, which is different from
`LogMessage` that we currently support.
When `Server trace` is selected, user can select the level of tracing
(`off`/`messages`/`verbose`) to their liking.

Release Notes:

- Added support for language server tracing to the LSP log view.
This commit is contained in:
Piotr Osiewicz 2024-07-29 01:53:30 +02:00 committed by GitHub
parent bb188f673e
commit a875dd153d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 301 additions and 139 deletions

View file

@ -8,6 +8,7 @@ use gpui::{Context, SemanticVersion, TestAppContext, VisualTestContext};
use language::{
tree_sitter_rust, FakeLspAdapter, Language, LanguageConfig, LanguageMatcher, LanguageServerName,
};
use lsp_log::LogKind;
use project::{FakeFs, Project};
use serde_json::json;
use settings::SettingsStore;
@ -92,8 +93,8 @@ async fn test_lsp_logs(cx: &mut TestAppContext) {
.root_name()
.to_string(),
rpc_trace_enabled: false,
rpc_trace_selected: false,
logs_selected: true,
selected_entry: LogKind::Logs,
trace_level: lsp::TraceValue::Off,
}]
);
assert_eq!(view.editor.read(cx).text(cx), "hello from the server\n");