mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
feat(lsp): add workspace symbol provider (#12787)
This commit is contained in:
parent
3abe31252e
commit
bf5657cd59
8 changed files with 303 additions and 24 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue