diff --git a/crates/lsp/src/lib.rs b/crates/lsp/src/lib.rs index e0bc679..35e0441 100644 --- a/crates/lsp/src/lib.rs +++ b/crates/lsp/src/lib.rs @@ -68,6 +68,23 @@ impl LanguageServer for LspBackend { ..Default::default() }, )), + semantic_tokens_provider: Some( + SemanticTokensServerCapabilities::SemanticTokensOptions( + SemanticTokensOptions { + work_done_progress_options: WorkDoneProgressOptions { + work_done_progress: None, + }, + legend: SemanticTokensLegend { + token_types: vec![SemanticTokenType::COMMENT], + token_modifiers: vec![], + }, + // TODO: range support + range: None, + // TODO: delta support + full: Some(SemanticTokensFullOptions::Bool(true)), + }, + ), + ), ..Default::default() }, server_info: Default::default(), @@ -131,6 +148,22 @@ impl LanguageServer for LspBackend { // update diagnostics self.update_diagnostics().await; } + + async fn semantic_tokens_full( + &self, + _params: SemanticTokensParams, + ) -> Result> { + Ok(Some(SemanticTokensResult::Tokens(SemanticTokens { + result_id: None, + data: vec![SemanticToken { + delta_line: 0, + delta_start: 0, + length: 30, + token_type: 0, + token_modifiers_bitset: 0, + }], + }))) + } } impl LspBackend {