diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-11-23 11:08:56 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 11:08:56 +1100 |
commit | bf5657cd590a0624d614a09ff6fc3538f94643da (patch) | |
tree | 26420625430f9b043d8406ed21039fb962b7a502 /cli/lsp/semantic_tokens.rs | |
parent | 3abe31252e02c3488727c7aa15a4d3a301d96531 (diff) |
feat(lsp): add workspace symbol provider (#12787)
Diffstat (limited to 'cli/lsp/semantic_tokens.rs')
-rw-r--r-- | cli/lsp/semantic_tokens.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cli/lsp/semantic_tokens.rs b/cli/lsp/semantic_tokens.rs index fe95a7377..326eb7dde 100644 --- a/cli/lsp/semantic_tokens.rs +++ b/cli/lsp/semantic_tokens.rs @@ -12,6 +12,9 @@ use lspower::lsp::SemanticTokens; use lspower::lsp::SemanticTokensLegend; use std::ops::{Index, IndexMut}; +pub(crate) const MODIFIER_MASK: u32 = 255; +pub(crate) const TYPE_OFFSET: u32 = 8; + enum TokenType { Class = 0, Enum = 1, @@ -78,12 +81,12 @@ pub fn get_legend() -> SemanticTokensLegend { token_types[TokenType::Method] = "method".into(); let mut token_modifiers = vec![SemanticTokenModifier::from(""); 6]; - token_modifiers[TokenModifier::Declaration] = "declaration".into(); - token_modifiers[TokenModifier::Static] = "static".into(); token_modifiers[TokenModifier::Async] = "async".into(); + token_modifiers[TokenModifier::Declaration] = "declaration".into(); token_modifiers[TokenModifier::Readonly] = "readonly".into(); - token_modifiers[TokenModifier::DefaultLibrary] = "defaultLibrary".into(); + token_modifiers[TokenModifier::Static] = "static".into(); token_modifiers[TokenModifier::Local] = "local".into(); + token_modifiers[TokenModifier::DefaultLibrary] = "defaultLibrary".into(); SemanticTokensLegend { token_types, @@ -91,11 +94,6 @@ pub fn get_legend() -> SemanticTokensLegend { } } -pub enum TsTokenEncodingConsts { - TypeOffset = 8, - ModifierMask = 255, -} - pub struct SemanticTokensBuilder { prev_line: u32, prev_char: u32, |