diff options
author | kjeremy <[email protected]> | 2020-09-01 17:53:07 +0100 |
---|---|---|
committer | kjeremy <[email protected]> | 2020-09-02 14:40:59 +0100 |
commit | b5272573300766d0c8417161c1a4f959abc9ff43 (patch) | |
tree | a22977735d0e6de4efd0395ac9dc64c70d0fc486 | |
parent | 3ffa915cbcf4d7a3988142cd94da0463acc87c8a (diff) |
Move to vscode-languageclient 7.0.0-next.9
Stabilizes call hierarchy and semantic tokens features.
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/caps.rs | 8 | ||||
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 20 | ||||
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 8 | ||||
-rw-r--r-- | crates/rust-analyzer/src/semantic_tokens.rs | 1 | ||||
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 6 | ||||
-rw-r--r-- | editors/code/package-lock.json | 30 | ||||
-rw-r--r-- | editors/code/package.json | 2 | ||||
-rw-r--r-- | editors/code/src/client.ts | 15 | ||||
-rw-r--r-- | editors/code/src/commands.ts | 8 | ||||
-rw-r--r-- | editors/code/src/ctx.ts | 2 | ||||
-rw-r--r-- | editors/code/src/util.ts | 2 |
13 files changed, 49 insertions, 59 deletions
diff --git a/Cargo.lock b/Cargo.lock index cec4462f2..0780257b4 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -778,9 +778,9 @@ dependencies = [ | |||
778 | 778 | ||
779 | [[package]] | 779 | [[package]] |
780 | name = "lsp-types" | 780 | name = "lsp-types" |
781 | version = "0.79.0" | 781 | version = "0.80.0" |
782 | source = "registry+https://github.com/rust-lang/crates.io-index" | 782 | source = "registry+https://github.com/rust-lang/crates.io-index" |
783 | checksum = "7f1f86677fdbe8df5f88b99131b1424e50aad27bbe3e5900d221bc414bd72e9b" | 783 | checksum = "f4265e2715bdacbb4dad029fce525e420cd66dc0af24ff9cb996a8ab48ac92ef" |
784 | dependencies = [ | 784 | dependencies = [ |
785 | "base64", | 785 | "base64", |
786 | "bitflags", | 786 | "bitflags", |
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index e06956d6c..8db0b0d72 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -21,7 +21,7 @@ env_logger = { version = "0.7.1", default-features = false } | |||
21 | itertools = "0.9.0" | 21 | itertools = "0.9.0" |
22 | jod-thread = "0.1.0" | 22 | jod-thread = "0.1.0" |
23 | log = "0.4.8" | 23 | log = "0.4.8" |
24 | lsp-types = { version = "0.79.0", features = ["proposed"] } | 24 | lsp-types = { version = "0.80.0", features = ["proposed"] } |
25 | parking_lot = "0.11.0" | 25 | parking_lot = "0.11.0" |
26 | pico-args = "0.3.1" | 26 | pico-args = "0.3.1" |
27 | oorandom = "11.1.2" | 27 | oorandom = "11.1.2" |
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs index 92a743fd8..de4bc2813 100644 --- a/crates/rust-analyzer/src/caps.rs +++ b/crates/rust-analyzer/src/caps.rs | |||
@@ -6,7 +6,7 @@ use lsp_types::{ | |||
6 | CodeActionProviderCapability, CodeLensOptions, CompletionOptions, | 6 | CodeActionProviderCapability, CodeLensOptions, CompletionOptions, |
7 | DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, HoverProviderCapability, | 7 | DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, HoverProviderCapability, |
8 | ImplementationProviderCapability, RenameOptions, RenameProviderCapability, SaveOptions, | 8 | ImplementationProviderCapability, RenameOptions, RenameProviderCapability, SaveOptions, |
9 | SelectionRangeProviderCapability, SemanticTokensDocumentProvider, SemanticTokensLegend, | 9 | SelectionRangeProviderCapability, SemanticTokensFullOptions, SemanticTokensLegend, |
10 | SemanticTokensOptions, ServerCapabilities, SignatureHelpOptions, TextDocumentSyncCapability, | 10 | SemanticTokensOptions, ServerCapabilities, SignatureHelpOptions, TextDocumentSyncCapability, |
11 | TextDocumentSyncKind, TextDocumentSyncOptions, TypeDefinitionProviderCapability, | 11 | TextDocumentSyncKind, TextDocumentSyncOptions, TypeDefinitionProviderCapability, |
12 | WorkDoneProgressOptions, | 12 | WorkDoneProgressOptions, |
@@ -76,10 +76,8 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti | |||
76 | token_modifiers: semantic_tokens::SUPPORTED_MODIFIERS.to_vec(), | 76 | token_modifiers: semantic_tokens::SUPPORTED_MODIFIERS.to_vec(), |
77 | }, | 77 | }, |
78 | 78 | ||
79 | document_provider: Some(SemanticTokensDocumentProvider::Edits { | 79 | full: Some(SemanticTokensFullOptions::Delta { delta: Some(true) }), |
80 | edits: Some(true), | 80 | range: Some(true), |
81 | }), | ||
82 | range_provider: Some(true), | ||
83 | work_done_progress_options: Default::default(), | 81 | work_done_progress_options: Default::default(), |
84 | } | 82 | } |
85 | .into(), | 83 | .into(), |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index d62dd0589..64cb4d96c 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -17,8 +17,8 @@ use lsp_types::{ | |||
17 | CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, | 17 | CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, |
18 | CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DocumentFormattingParams, | 18 | CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DocumentFormattingParams, |
19 | DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, HoverContents, Location, | 19 | DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, HoverContents, Location, |
20 | Position, PrepareRenameResponse, Range, RenameParams, SemanticTokensEditResult, | 20 | Position, PrepareRenameResponse, Range, RenameParams, SemanticTokensDeltaParams, |
21 | SemanticTokensEditsParams, SemanticTokensParams, SemanticTokensRangeParams, | 21 | SemanticTokensFullDeltaResult, SemanticTokensParams, SemanticTokensRangeParams, |
22 | SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag, | 22 | SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag, |
23 | TextDocumentIdentifier, Url, WorkspaceEdit, | 23 | TextDocumentIdentifier, Url, WorkspaceEdit, |
24 | }; | 24 | }; |
@@ -1171,11 +1171,11 @@ pub(crate) fn handle_call_hierarchy_outgoing( | |||
1171 | Ok(Some(res)) | 1171 | Ok(Some(res)) |
1172 | } | 1172 | } |
1173 | 1173 | ||
1174 | pub(crate) fn handle_semantic_tokens( | 1174 | pub(crate) fn handle_semantic_tokens_full( |
1175 | snap: GlobalStateSnapshot, | 1175 | snap: GlobalStateSnapshot, |
1176 | params: SemanticTokensParams, | 1176 | params: SemanticTokensParams, |
1177 | ) -> Result<Option<SemanticTokensResult>> { | 1177 | ) -> Result<Option<SemanticTokensResult>> { |
1178 | let _p = profile::span("handle_semantic_tokens"); | 1178 | let _p = profile::span("handle_semantic_tokens_full"); |
1179 | 1179 | ||
1180 | let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; | 1180 | let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; |
1181 | let text = snap.analysis.file_text(file_id)?; | 1181 | let text = snap.analysis.file_text(file_id)?; |
@@ -1190,11 +1190,11 @@ pub(crate) fn handle_semantic_tokens( | |||
1190 | Ok(Some(semantic_tokens.into())) | 1190 | Ok(Some(semantic_tokens.into())) |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | pub(crate) fn handle_semantic_tokens_edits( | 1193 | pub(crate) fn handle_semantic_tokens_full_delta( |
1194 | snap: GlobalStateSnapshot, | 1194 | snap: GlobalStateSnapshot, |
1195 | params: SemanticTokensEditsParams, | 1195 | params: SemanticTokensDeltaParams, |
1196 | ) -> Result<Option<SemanticTokensEditResult>> { | 1196 | ) -> Result<Option<SemanticTokensFullDeltaResult>> { |
1197 | let _p = profile::span("handle_semantic_tokens_edits"); | 1197 | let _p = profile::span("handle_semantic_tokens_full_delta"); |
1198 | 1198 | ||
1199 | let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; | 1199 | let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; |
1200 | let text = snap.analysis.file_text(file_id)?; | 1200 | let text = snap.analysis.file_text(file_id)?; |
@@ -1209,9 +1209,9 @@ pub(crate) fn handle_semantic_tokens_edits( | |||
1209 | 1209 | ||
1210 | if let Some(prev_id) = &cached_tokens.result_id { | 1210 | if let Some(prev_id) = &cached_tokens.result_id { |
1211 | if *prev_id == params.previous_result_id { | 1211 | if *prev_id == params.previous_result_id { |
1212 | let edits = to_proto::semantic_token_edits(&cached_tokens, &semantic_tokens); | 1212 | let delta = to_proto::semantic_token_delta(&cached_tokens, &semantic_tokens); |
1213 | *cached_tokens = semantic_tokens; | 1213 | *cached_tokens = semantic_tokens; |
1214 | return Ok(Some(edits.into())); | 1214 | return Ok(Some(delta.into())); |
1215 | } | 1215 | } |
1216 | } | 1216 | } |
1217 | 1217 | ||
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 355caaee2..8d3132581 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -407,9 +407,11 @@ impl GlobalState { | |||
407 | .on::<lsp_types::request::CallHierarchyOutgoingCalls>( | 407 | .on::<lsp_types::request::CallHierarchyOutgoingCalls>( |
408 | handlers::handle_call_hierarchy_outgoing, | 408 | handlers::handle_call_hierarchy_outgoing, |
409 | )? | 409 | )? |
410 | .on::<lsp_types::request::SemanticTokensRequest>(handlers::handle_semantic_tokens)? | 410 | .on::<lsp_types::request::SemanticTokensFullRequest>( |
411 | .on::<lsp_types::request::SemanticTokensEditsRequest>( | 411 | handlers::handle_semantic_tokens_full, |
412 | handlers::handle_semantic_tokens_edits, | 412 | )? |
413 | .on::<lsp_types::request::SemanticTokensFullDeltaRequest>( | ||
414 | handlers::handle_semantic_tokens_full_delta, | ||
413 | )? | 415 | )? |
414 | .on::<lsp_types::request::SemanticTokensRangeRequest>( | 416 | .on::<lsp_types::request::SemanticTokensRangeRequest>( |
415 | handlers::handle_semantic_tokens_range, | 417 | handlers::handle_semantic_tokens_range, |
diff --git a/crates/rust-analyzer/src/semantic_tokens.rs b/crates/rust-analyzer/src/semantic_tokens.rs index 9db7b8af5..1225d3e35 100644 --- a/crates/rust-analyzer/src/semantic_tokens.rs +++ b/crates/rust-analyzer/src/semantic_tokens.rs | |||
@@ -31,7 +31,6 @@ macro_rules! define_semantic_token_types { | |||
31 | SemanticTokenType::MACRO, | 31 | SemanticTokenType::MACRO, |
32 | SemanticTokenType::VARIABLE, | 32 | SemanticTokenType::VARIABLE, |
33 | SemanticTokenType::PARAMETER, | 33 | SemanticTokenType::PARAMETER, |
34 | SemanticTokenType::LABEL, | ||
35 | $($ident),* | 34 | $($ident),* |
36 | ]; | 35 | ]; |
37 | }; | 36 | }; |
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index a8173a338..16aab52c2 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -334,13 +334,13 @@ pub(crate) fn semantic_tokens( | |||
334 | builder.build() | 334 | builder.build() |
335 | } | 335 | } |
336 | 336 | ||
337 | pub(crate) fn semantic_token_edits( | 337 | pub(crate) fn semantic_token_delta( |
338 | previous: &lsp_types::SemanticTokens, | 338 | previous: &lsp_types::SemanticTokens, |
339 | current: &lsp_types::SemanticTokens, | 339 | current: &lsp_types::SemanticTokens, |
340 | ) -> lsp_types::SemanticTokensEdits { | 340 | ) -> lsp_types::SemanticTokensDelta { |
341 | let result_id = current.result_id.clone(); | 341 | let result_id = current.result_id.clone(); |
342 | let edits = semantic_tokens::diff_tokens(&previous.data, ¤t.data); | 342 | let edits = semantic_tokens::diff_tokens(&previous.data, ¤t.data); |
343 | lsp_types::SemanticTokensEdits { result_id, edits } | 343 | lsp_types::SemanticTokensDelta { result_id, edits } |
344 | } | 344 | } |
345 | 345 | ||
346 | fn semantic_token_type_and_modifiers( | 346 | fn semantic_token_type_and_modifiers( |
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index 0c74561f1..63ba4bdf1 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json | |||
@@ -2409,32 +2409,32 @@ | |||
2409 | } | 2409 | } |
2410 | }, | 2410 | }, |
2411 | "vscode-jsonrpc": { | 2411 | "vscode-jsonrpc": { |
2412 | "version": "5.1.0-next.1", | 2412 | "version": "6.0.0-next.5", |
2413 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.1.0-next.1.tgz", | 2413 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.5.tgz", |
2414 | "integrity": "sha512-mwLDojZkbmpizSJSmp690oa9FB9jig18SIDGZeBCvFc2/LYSRvMm/WwWtMBJuJ1MfFh7rZXfQige4Uje5Z9NzA==" | 2414 | "integrity": "sha512-IAgsltQPwg/pXOPsdXgbUTCaO9VSKZwirZN5SGtkdYQ/R3VjeC4v00WTVvoNayWMZpoC3O9u0ogqmsKzKhVasQ==" |
2415 | }, | 2415 | }, |
2416 | "vscode-languageclient": { | 2416 | "vscode-languageclient": { |
2417 | "version": "7.0.0-next.1", | 2417 | "version": "7.0.0-next.9", |
2418 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.1.tgz", | 2418 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.9.tgz", |
2419 | "integrity": "sha512-JrjCUhLpQZxQ5VpWpilOHDMhVsn0fdN5jBh1uFNhSr5c2loJvRdr9Km2EuSQOFfOQsBKx0+xvY8PbsypNEcJ6w==", | 2419 | "integrity": "sha512-lFO+rN/i72CM2va6iKXq1lD7pJg8J93KEXf0w0boWVqU+DJhWzLrV3pXl8Xk1nCv//qOAyhlc/nx2KZCTeRF/A==", |
2420 | "requires": { | 2420 | "requires": { |
2421 | "semver": "^6.3.0", | 2421 | "semver": "^6.3.0", |
2422 | "vscode-languageserver-protocol": "3.16.0-next.2" | 2422 | "vscode-languageserver-protocol": "3.16.0-next.7" |
2423 | } | 2423 | } |
2424 | }, | 2424 | }, |
2425 | "vscode-languageserver-protocol": { | 2425 | "vscode-languageserver-protocol": { |
2426 | "version": "3.16.0-next.2", | 2426 | "version": "3.16.0-next.7", |
2427 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.2.tgz", | 2427 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.7.tgz", |
2428 | "integrity": "sha512-atmkGT/W6tF0cx4SaWFYtFs2UeSeC28RPiap9myv2YZTaTCFvTBEPNWrU5QRKfkyM0tbgtGo6T3UCQ8tkDpjzA==", | 2428 | "integrity": "sha512-tOjrg+K3RddJ547zpC9/LAgTbzadkPuHlqJFFWIcKjVhiJOh73XyY+Ngcu9wukGaTsuSGjJ0W8rlmwanixa0FQ==", |
2429 | "requires": { | 2429 | "requires": { |
2430 | "vscode-jsonrpc": "5.1.0-next.1", | 2430 | "vscode-jsonrpc": "6.0.0-next.5", |
2431 | "vscode-languageserver-types": "3.16.0-next.1" | 2431 | "vscode-languageserver-types": "3.16.0-next.3" |
2432 | } | 2432 | } |
2433 | }, | 2433 | }, |
2434 | "vscode-languageserver-types": { | 2434 | "vscode-languageserver-types": { |
2435 | "version": "3.16.0-next.1", | 2435 | "version": "3.16.0-next.3", |
2436 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.1.tgz", | 2436 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.3.tgz", |
2437 | "integrity": "sha512-tZFUSbyjUcrh+qQf13ALX4QDdOfDX0cVaBFgy7ktJ0VwS7AW/yRKgGPSxVqqP9OCMNPdqP57O5q47w2pEwfaUg==" | 2437 | "integrity": "sha512-s/z5ZqSe7VpoXJ6JQcvwRiPPA3nG0nAcJ/HH03zoU6QaFfnkcgPK+HshC3WKPPnC2G08xA0iRB6h7kmyBB5Adg==" |
2438 | }, | 2438 | }, |
2439 | "vscode-test": { | 2439 | "vscode-test": { |
2440 | "version": "1.4.0", | 2440 | "version": "1.4.0", |
diff --git a/editors/code/package.json b/editors/code/package.json index 7828407ad..6fc4464df 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -36,7 +36,7 @@ | |||
36 | }, | 36 | }, |
37 | "dependencies": { | 37 | "dependencies": { |
38 | "node-fetch": "^2.6.0", | 38 | "node-fetch": "^2.6.0", |
39 | "vscode-languageclient": "7.0.0-next.1" | 39 | "vscode-languageclient": "7.0.0-next.9" |
40 | }, | 40 | }, |
41 | "devDependencies": { | 41 | "devDependencies": { |
42 | "@rollup/plugin-commonjs": "^13.0.2", | 42 | "@rollup/plugin-commonjs": "^13.0.2", |
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index f5db55b8c..1ba2352ee 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import * as lc from 'vscode-languageclient'; | 1 | import * as lc from 'vscode-languageclient/node'; |
2 | import * as vscode from 'vscode'; | 2 | import * as vscode from 'vscode'; |
3 | import * as ra from '../src/lsp_ext'; | 3 | import * as ra from '../src/lsp_ext'; |
4 | import * as Is from 'vscode-languageclient/lib/utils/is'; | 4 | import * as Is from 'vscode-languageclient/lib/common/utils/is'; |
5 | |||
6 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; | ||
7 | import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed'; | ||
8 | import { assert } from './util'; | 5 | import { assert } from './util'; |
9 | 6 | ||
10 | function renderCommand(cmd: ra.CommandLink) { | 7 | function renderCommand(cmd: ra.CommandLink) { |
@@ -57,7 +54,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient | |||
57 | return hover; | 54 | return hover; |
58 | }, | 55 | }, |
59 | (error) => { | 56 | (error) => { |
60 | client.logFailedRequest(lc.HoverRequest.type, error); | 57 | client.handleFailedRequest(lc.HoverRequest.type, error, null); |
61 | return Promise.resolve(null); | 58 | return Promise.resolve(null); |
62 | }); | 59 | }); |
63 | }, | 60 | }, |
@@ -140,12 +137,6 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient | |||
140 | ); | 137 | ); |
141 | 138 | ||
142 | // To turn on all proposed features use: client.registerProposedFeatures(); | 139 | // To turn on all proposed features use: client.registerProposedFeatures(); |
143 | // Here we want to enable CallHierarchyFeature and SemanticTokensFeature | ||
144 | // since they are available on stable. | ||
145 | // Note that while these features are stable in vscode their LSP protocol | ||
146 | // implementations are still in the "proposed" category for 3.16. | ||
147 | client.registerFeature(new CallHierarchyFeature(client)); | ||
148 | client.registerFeature(new SemanticTokensFeature(client)); | ||
149 | client.registerFeature(new ExperimentalFeatures()); | 140 | client.registerFeature(new ExperimentalFeatures()); |
150 | 141 | ||
151 | return client; | 142 | return client; |
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index d0faf4745..69f2836ad 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts | |||
@@ -63,7 +63,7 @@ export function memoryUsage(ctx: Ctx): Cmd { | |||
63 | provideTextDocumentContent(_uri: vscode.Uri): vscode.ProviderResult<string> { | 63 | provideTextDocumentContent(_uri: vscode.Uri): vscode.ProviderResult<string> { |
64 | if (!vscode.window.activeTextEditor) return ''; | 64 | if (!vscode.window.activeTextEditor) return ''; |
65 | 65 | ||
66 | return ctx.client.sendRequest(ra.memoryUsage, null).then((mem) => { | 66 | return ctx.client.sendRequest(ra.memoryUsage, null).then((mem: any) => { |
67 | return 'Per-query memory usage:\n' + mem + '\n(note: database has been cleared)'; | 67 | return 'Per-query memory usage:\n' + mem + '\n(note: database has been cleared)'; |
68 | }); | 68 | }); |
69 | } | 69 | } |
@@ -121,7 +121,7 @@ export function joinLines(ctx: Ctx): Cmd { | |||
121 | textDocument: { uri: editor.document.uri.toString() }, | 121 | textDocument: { uri: editor.document.uri.toString() }, |
122 | }); | 122 | }); |
123 | editor.edit((builder) => { | 123 | editor.edit((builder) => { |
124 | client.protocol2CodeConverter.asTextEdits(items).forEach((edit) => { | 124 | client.protocol2CodeConverter.asTextEdits(items).forEach((edit: any) => { |
125 | builder.replace(edit.range, edit.newText); | 125 | builder.replace(edit.range, edit.newText); |
126 | }); | 126 | }); |
127 | }); | 127 | }); |
@@ -140,8 +140,8 @@ export function onEnter(ctx: Ctx): Cmd { | |||
140 | position: client.code2ProtocolConverter.asPosition( | 140 | position: client.code2ProtocolConverter.asPosition( |
141 | editor.selection.active, | 141 | editor.selection.active, |
142 | ), | 142 | ), |
143 | }).catch(_error => { | 143 | }).catch((_error: any) => { |
144 | // client.logFailedRequest(OnEnterRequest.type, error); | 144 | // client.handleFailedRequest(OnEnterRequest.type, error, null); |
145 | return null; | 145 | return null; |
146 | }); | 146 | }); |
147 | if (!lcEdits) return false; | 147 | if (!lcEdits) return false; |
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 543f7e02e..d39864d33 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | import * as lc from 'vscode-languageclient'; | 2 | import * as lc from 'vscode-languageclient/node'; |
3 | import * as ra from './lsp_ext'; | 3 | import * as ra from './lsp_ext'; |
4 | 4 | ||
5 | import { Config } from './config'; | 5 | import { Config } from './config'; |
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index ec2087502..08159b43c 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as lc from "vscode-languageclient"; | 1 | import * as lc from "vscode-languageclient/node"; |
2 | import * as vscode from "vscode"; | 2 | import * as vscode from "vscode"; |
3 | import { strict as nativeAssert } from "assert"; | 3 | import { strict as nativeAssert } from "assert"; |
4 | import { spawnSync } from "child_process"; | 4 | import { spawnSync } from "child_process"; |