aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock4
-rw-r--r--crates/rust-analyzer/Cargo.toml2
-rw-r--r--crates/rust-analyzer/src/caps.rs3
-rw-r--r--crates/rust-analyzer/src/diagnostics/to_proto.rs4
-rw-r--r--crates/rust-analyzer/src/handlers.rs2
-rw-r--r--crates/rust-analyzer/src/to_proto.rs11
-rw-r--r--editors/code/package-lock.json30
-rw-r--r--editors/code/package.json2
-rw-r--r--editors/code/src/util.ts5
9 files changed, 39 insertions, 24 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5c7bcb17b..fe211b9b3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -852,9 +852,9 @@ dependencies = [
852 852
853[[package]] 853[[package]]
854name = "lsp-types" 854name = "lsp-types"
855version = "0.82.0" 855version = "0.83.0"
856source = "registry+https://github.com/rust-lang/crates.io-index" 856source = "registry+https://github.com/rust-lang/crates.io-index"
857checksum = "db895abb8527cf59e3de893ab2acf52cf904faeb65e60ea6f373e11fe86464e8" 857checksum = "25e0bd4b95038f2c23bda332ba0ca684e8dda765db1f9bdb63dc4c3e01f3b456"
858dependencies = [ 858dependencies = [
859 "base64", 859 "base64",
860 "bitflags", 860 "bitflags",
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 975b24aaf..d25c4bf83 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -21,7 +21,7 @@ env_logger = { version = "0.8.1", default-features = false }
21itertools = "0.9.0" 21itertools = "0.9.0"
22jod-thread = "0.1.0" 22jod-thread = "0.1.0"
23log = "0.4.8" 23log = "0.4.8"
24lsp-types = { version = "0.82.0", features = ["proposed"] } 24lsp-types = { version = "0.83.0", features = ["proposed"] }
25parking_lot = "0.11.0" 25parking_lot = "0.11.0"
26pico-args = "0.3.1" 26pico-args = "0.3.1"
27oorandom = "11.1.2" 27oorandom = "11.1.2"
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs
index c589afeaf..ff1ae9575 100644
--- a/crates/rust-analyzer/src/caps.rs
+++ b/crates/rust-analyzer/src/caps.rs
@@ -48,7 +48,7 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti
48 references_provider: Some(OneOf::Left(true)), 48 references_provider: Some(OneOf::Left(true)),
49 document_highlight_provider: Some(OneOf::Left(true)), 49 document_highlight_provider: Some(OneOf::Left(true)),
50 document_symbol_provider: Some(OneOf::Left(true)), 50 document_symbol_provider: Some(OneOf::Left(true)),
51 workspace_symbol_provider: Some(true), 51 workspace_symbol_provider: Some(OneOf::Left(true)),
52 code_action_provider: Some(code_action_provider), 52 code_action_provider: Some(code_action_provider),
53 code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }), 53 code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }),
54 document_formatting_provider: Some(OneOf::Left(true)), 54 document_formatting_provider: Some(OneOf::Left(true)),
@@ -113,6 +113,7 @@ fn code_action_capabilities(client_caps: &ClientCapabilities) -> CodeActionProvi
113 CodeActionKind::REFACTOR_INLINE, 113 CodeActionKind::REFACTOR_INLINE,
114 CodeActionKind::REFACTOR_REWRITE, 114 CodeActionKind::REFACTOR_REWRITE,
115 ]), 115 ]),
116 resolve_provider: None,
116 work_done_progress_options: Default::default(), 117 work_done_progress_options: Default::default(),
117 }) 118 })
118 }) 119 })
diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs
index 33606edda..b949577c1 100644
--- a/crates/rust-analyzer/src/diagnostics/to_proto.rs
+++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs
@@ -248,10 +248,12 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
248 range: in_macro_location.range, 248 range: in_macro_location.range,
249 severity, 249 severity,
250 code: code.clone().map(lsp_types::NumberOrString::String), 250 code: code.clone().map(lsp_types::NumberOrString::String),
251 code_description: None,
251 source: Some(source.clone()), 252 source: Some(source.clone()),
252 message: message.clone(), 253 message: message.clone(),
253 related_information: Some(information_for_additional_diagnostic), 254 related_information: Some(information_for_additional_diagnostic),
254 tags: if tags.is_empty() { None } else { Some(tags.clone()) }, 255 tags: if tags.is_empty() { None } else { Some(tags.clone()) },
256 data: None,
255 }; 257 };
256 258
257 Some(MappedRustDiagnostic { 259 Some(MappedRustDiagnostic {
@@ -267,6 +269,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
267 range: location.range, 269 range: location.range,
268 severity, 270 severity,
269 code: code.clone().map(lsp_types::NumberOrString::String), 271 code: code.clone().map(lsp_types::NumberOrString::String),
272 code_description: None,
270 source: Some(source.clone()), 273 source: Some(source.clone()),
271 message, 274 message,
272 related_information: if related_information.is_empty() { 275 related_information: if related_information.is_empty() {
@@ -275,6 +278,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
275 Some(related_information.clone()) 278 Some(related_information.clone())
276 }, 279 },
277 tags: if tags.is_empty() { None } else { Some(tags.clone()) }, 280 tags: if tags.is_empty() { None } else { Some(tags.clone()) },
281 data: None,
278 }; 282 };
279 283
280 let main_diagnostic = 284 let main_diagnostic =
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 2680e5f08..049c583a4 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -1121,10 +1121,12 @@ pub(crate) fn publish_diagnostics(
1121 range: to_proto::range(&line_index, d.range), 1121 range: to_proto::range(&line_index, d.range),
1122 severity: Some(to_proto::diagnostic_severity(d.severity)), 1122 severity: Some(to_proto::diagnostic_severity(d.severity)),
1123 code: None, 1123 code: None,
1124 code_description: None,
1124 source: Some("rust-analyzer".to_string()), 1125 source: Some("rust-analyzer".to_string()),
1125 message: d.message, 1126 message: d.message,
1126 related_information: None, 1127 related_information: None,
1127 tags: if d.unused { Some(vec![DiagnosticTag::Unnecessary]) } else { None }, 1128 tags: if d.unused { Some(vec![DiagnosticTag::Unnecessary]) } else { None },
1129 data: None,
1128 }) 1130 })
1129 .collect(); 1131 .collect();
1130 Ok(diagnostics) 1132 Ok(diagnostics)
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 24a658fc6..92b7c7b68 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -709,7 +709,16 @@ pub(crate) fn call_hierarchy_item(
709 let detail = target.description.clone(); 709 let detail = target.description.clone();
710 let kind = symbol_kind(target.kind); 710 let kind = symbol_kind(target.kind);
711 let (uri, range, selection_range) = location_info(snap, target)?; 711 let (uri, range, selection_range) = location_info(snap, target)?;
712 Ok(lsp_types::CallHierarchyItem { name, kind, tags: None, detail, uri, range, selection_range }) 712 Ok(lsp_types::CallHierarchyItem {
713 name,
714 kind,
715 tags: None,
716 detail,
717 uri,
718 range,
719 selection_range,
720 data: None,
721 })
713} 722}
714 723
715pub(crate) fn code_action_kind(kind: AssistKind) -> lsp_types::CodeActionKind { 724pub(crate) fn code_action_kind(kind: AssistKind) -> lsp_types::CodeActionKind {
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index 33d60d4dd..86c3730ad 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": "6.0.0-next.5", 2412 "version": "6.0.0-next.6",
2413 "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.5.tgz", 2413 "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.6.tgz",
2414 "integrity": "sha512-IAgsltQPwg/pXOPsdXgbUTCaO9VSKZwirZN5SGtkdYQ/R3VjeC4v00WTVvoNayWMZpoC3O9u0ogqmsKzKhVasQ==" 2414 "integrity": "sha512-w3w1T9tGsInSbGyv2kpi4o6ciMIyfVkM+kAvkxEv4zIv3fs69q3Qyt7ZMLiXnaRFXecIOY2ALDKwIMi0n2IwHQ=="
2415 }, 2415 },
2416 "vscode-languageclient": { 2416 "vscode-languageclient": {
2417 "version": "7.0.0-next.9", 2417 "version": "7.0.0-next.10",
2418 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.9.tgz", 2418 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.10.tgz",
2419 "integrity": "sha512-lFO+rN/i72CM2va6iKXq1lD7pJg8J93KEXf0w0boWVqU+DJhWzLrV3pXl8Xk1nCv//qOAyhlc/nx2KZCTeRF/A==", 2419 "integrity": "sha512-J9Hp64j1aaQfXlhMPGI1XAcdsIcSNPAL6022JElzgxsfAydmQfZeKCCNdyybjhmZ+xrep2yoVRAeD5TZFP7y6g==",
2420 "requires": { 2420 "requires": {
2421 "semver": "^6.3.0", 2421 "semver": "^6.3.0",
2422 "vscode-languageserver-protocol": "3.16.0-next.7" 2422 "vscode-languageserver-protocol": "3.16.0-next.8"
2423 } 2423 }
2424 }, 2424 },
2425 "vscode-languageserver-protocol": { 2425 "vscode-languageserver-protocol": {
2426 "version": "3.16.0-next.7", 2426 "version": "3.16.0-next.8",
2427 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.7.tgz", 2427 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.8.tgz",
2428 "integrity": "sha512-tOjrg+K3RddJ547zpC9/LAgTbzadkPuHlqJFFWIcKjVhiJOh73XyY+Ngcu9wukGaTsuSGjJ0W8rlmwanixa0FQ==", 2428 "integrity": "sha512-AWMc7vVN7xuTpQf6A7yvaYjxyKEeMBQWJpkcRgT3EFAYU8PXJK2NCL0wPrgHH2soF/bErxJwajA1vNtCqrsRsg==",
2429 "requires": { 2429 "requires": {
2430 "vscode-jsonrpc": "6.0.0-next.5", 2430 "vscode-jsonrpc": "6.0.0-next.6",
2431 "vscode-languageserver-types": "3.16.0-next.3" 2431 "vscode-languageserver-types": "3.16.0-next.4"
2432 } 2432 }
2433 }, 2433 },
2434 "vscode-languageserver-types": { 2434 "vscode-languageserver-types": {
2435 "version": "3.16.0-next.3", 2435 "version": "3.16.0-next.4",
2436 "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.3.tgz", 2436 "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.4.tgz",
2437 "integrity": "sha512-s/z5ZqSe7VpoXJ6JQcvwRiPPA3nG0nAcJ/HH03zoU6QaFfnkcgPK+HshC3WKPPnC2G08xA0iRB6h7kmyBB5Adg==" 2437 "integrity": "sha512-NlKJyGcET/ZBCCLBYIPaGo2c37R03bPYeWXozUtnjyye7+9dhlbMSODyoG2INcQf8zFmB4qhm2UOJjgYEgPCNA=="
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 af845d7bc..26044491c 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.1", 38 "node-fetch": "^2.6.1",
39 "vscode-languageclient": "7.0.0-next.9" 39 "vscode-languageclient": "7.0.0-next.10"
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/util.ts b/editors/code/src/util.ts
index 08159b43c..53492a445 100644
--- a/editors/code/src/util.ts
+++ b/editors/code/src/util.ts
@@ -75,12 +75,11 @@ export async function sendRequestWithRetry<TParam, TRet>(
75 log.warn("LSP request timed out", { method: reqType.method, param, error }); 75 log.warn("LSP request timed out", { method: reqType.method, param, error });
76 throw error; 76 throw error;
77 } 77 }
78 78 if (error.code === lc.LSPErrorCodes.RequestCancelled) {
79 if (error.code === lc.ErrorCodes.RequestCancelled) {
80 throw error; 79 throw error;
81 } 80 }
82 81
83 if (error.code !== lc.ErrorCodes.ContentModified) { 82 if (error.code !== lc.LSPErrorCodes.ContentModified) {
84 log.warn("LSP request failed", { method: reqType.method, param, error }); 83 log.warn("LSP request failed", { method: reqType.method, param, error });
85 throw error; 84 throw error;
86 } 85 }