diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-30 17:38:53 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-30 17:38:53 +0100 |
commit | 159393745e7a9d102c8ef42dfb07128ebc2e2df0 (patch) | |
tree | f33561c0a48dfeca9a029852d15352661084734c /crates/rust-analyzer/src/main_loop/handlers.rs | |
parent | 671926ac93f0ff921758a919eaf87c056979189f (diff) | |
parent | d4c317320d58fa5d31eab6f3533c14ad2c12d78d (diff) |
Merge #3774
3774: Simplify SemanticTokensBuilder build method r=matklad a=kjeremy
This matches the next stable vscode api
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/rust-analyzer/src/main_loop/handlers.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 12f8ca297..f60a3f0a0 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -14,7 +14,7 @@ use lsp_types::{ | |||
14 | CodeAction, CodeActionResponse, CodeLens, Command, CompletionItem, Diagnostic, | 14 | CodeAction, CodeActionResponse, CodeLens, Command, CompletionItem, Diagnostic, |
15 | DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, | 15 | DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, |
16 | Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, | 16 | Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, |
17 | Range, RenameParams, SemanticTokens, SemanticTokensParams, SemanticTokensRangeParams, | 17 | Range, RenameParams, SemanticTokensParams, SemanticTokensRangeParams, |
18 | SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, TextDocumentIdentifier, | 18 | SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, TextDocumentIdentifier, |
19 | TextEdit, WorkspaceEdit, | 19 | TextEdit, WorkspaceEdit, |
20 | }; | 20 | }; |
@@ -1145,7 +1145,7 @@ pub fn handle_semantic_tokens( | |||
1145 | } | 1145 | } |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | let tokens = SemanticTokens { data: builder.build(), ..Default::default() }; | 1148 | let tokens = builder.build(); |
1149 | 1149 | ||
1150 | Ok(Some(tokens.into())) | 1150 | Ok(Some(tokens.into())) |
1151 | } | 1151 | } |
@@ -1166,7 +1166,7 @@ pub fn handle_semantic_tokens_range( | |||
1166 | builder.push(highlight_range.range.conv_with(&line_index), token_type, token_modifiers); | 1166 | builder.push(highlight_range.range.conv_with(&line_index), token_type, token_modifiers); |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | let tokens = SemanticTokens { data: builder.build(), ..Default::default() }; | 1169 | let tokens = builder.build(); |
1170 | 1170 | ||
1171 | Ok(Some(tokens.into())) | 1171 | Ok(Some(tokens.into())) |
1172 | } | 1172 | } |