CodeAction, CodeActionResponse, CodeLens, Command, CompletionItem, Diagnostic,
DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams,
Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse,
- Range, RenameParams, SemanticTokens, SemanticTokensParams, SemanticTokensRangeParams,
+ Range, RenameParams, SemanticTokensParams, SemanticTokensRangeParams,
SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, TextDocumentIdentifier,
TextEdit, WorkspaceEdit,
};
}
}
- let tokens = SemanticTokens { data: builder.build(), ..Default::default() };
+ let tokens = builder.build();
Ok(Some(tokens.into()))
}
builder.push(highlight_range.range.conv_with(&line_index), token_type, token_modifiers);
}
- let tokens = SemanticTokens { data: builder.build(), ..Default::default() };
+ let tokens = builder.build();
Ok(Some(tokens.into()))
}
use std::ops;
-use lsp_types::{Range, SemanticToken, SemanticTokenModifier, SemanticTokenType};
+use lsp_types::{Range, SemanticToken, SemanticTokenModifier, SemanticTokenType, SemanticTokens};
pub(crate) const ATTRIBUTE: SemanticTokenType = SemanticTokenType::new("attribute");
pub(crate) const BUILTIN_TYPE: SemanticTokenType = SemanticTokenType::new("builtinType");
self.prev_char = range.start.character as u32;
}
- pub fn build(self) -> Vec<SemanticToken> {
- self.data
+ pub fn build(self) -> SemanticTokens {
+ SemanticTokens { result_id: None, data: self.data }
}
}