diff --git a/cli/lsp/capabilities.rs b/cli/lsp/capabilities.rs
index cce349a5d7ccde..f0312cc6d6bd5c 100644
--- a/cli/lsp/capabilities.rs
+++ b/cli/lsp/capabilities.rs
@@ -18,6 +18,9 @@ use lspower::lsp::ImplementationProviderCapability;
use lspower::lsp::OneOf;
use lspower::lsp::SaveOptions;
use lspower::lsp::SelectionRangeProviderCapability;
+use lspower::lsp::SemanticTokensFullOptions;
+use lspower::lsp::SemanticTokensOptions;
+use lspower::lsp::SemanticTokensServerCapabilities;
use lspower::lsp::ServerCapabilities;
use lspower::lsp::SignatureHelpOptions;
use lspower::lsp::TextDocumentSyncCapability;
@@ -25,6 +28,8 @@ use lspower::lsp::TextDocumentSyncKind;
use lspower::lsp::TextDocumentSyncOptions;
use lspower::lsp::WorkDoneProgressOptions;
+use super::semantic_tokens::get_legend;
+
fn code_action_capabilities(
client_capabilities: &ClientCapabilities,
) -> CodeActionProviderCapability {
@@ -116,7 +121,16 @@ pub fn server_capabilities(
color_provider: None,
execute_command_provider: None,
call_hierarchy_provider: Some(CallHierarchyServerCapability::Simple(true)),
- semantic_tokens_provider: None,
+ semantic_tokens_provider: Some(
+ SemanticTokensServerCapabilities::SemanticTokensOptions(
+ SemanticTokensOptions {
+ legend: get_legend(),
+ range: Some(true),
+ full: Some(SemanticTokensFullOptions::Bool(true)),
+ ..Default::default()
+ },
+ ),
+ ),
workspace: None,
experimental: None,
linked_editing_range_provider: None,
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index ce16f8705205cb..6edfdc74b6bcd1 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -1961,6 +1961,99 @@ impl Inner {
Ok(Some(selection_ranges))
}
+ async fn semantic_tokens_full(
+ &self,
+ params: SemanticTokensParams,
+ ) -> LspResult