aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock6
-rw-r--r--crates/ra_lsp_server/Cargo.toml2
-rw-r--r--crates/ra_lsp_server/src/caps.rs7
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs3
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs5
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs21
-rw-r--r--editors/code/src/commands/analyzer_status.ts2
-rw-r--r--editors/code/src/commands/expand_macro.ts2
-rw-r--r--editors/code/src/commands/runnables.ts16
-rw-r--r--editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts3
-rw-r--r--editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts6
-rw-r--r--editors/code/src/test/utils/diagnotics/rust.test.ts6
-rw-r--r--editors/code/tsconfig.json9
-rw-r--r--editors/code/tslint.json4
14 files changed, 66 insertions, 26 deletions
diff --git a/Cargo.lock b/Cargo.lock
index caa52fb69..3c567376e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -620,7 +620,7 @@ dependencies = [
620 620
621[[package]] 621[[package]]
622name = "lsp-types" 622name = "lsp-types"
623version = "0.61.0" 623version = "0.63.0"
624source = "registry+https://github.com/rust-lang/crates.io-index" 624source = "registry+https://github.com/rust-lang/crates.io-index"
625dependencies = [ 625dependencies = [
626 "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 626 "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1048,7 +1048,7 @@ dependencies = [
1048 "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 1048 "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1049 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 1049 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
1050 "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 1050 "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1051 "lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)", 1051 "lsp-types 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)",
1052 "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 1052 "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
1053 "ra_ide 0.1.0", 1053 "ra_ide 0.1.0",
1054 "ra_prof 0.1.0", 1054 "ra_prof 0.1.0",
@@ -1839,7 +1839,7 @@ dependencies = [
1839"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" 1839"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586"
1840"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 1840"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
1841"checksum lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ba36405bd742139ab79c246ca5adb7fde2fe1a0f495e2c8e2f607b607dedb12" 1841"checksum lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ba36405bd742139ab79c246ca5adb7fde2fe1a0f495e2c8e2f607b607dedb12"
1842"checksum lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa3268fbe8beb2795c2fb327bf44f4f3d24f5fe9ebc18d7e2980afd444d72bcf" 1842"checksum lsp-types 0.63.0 (registry+https://github.com/rust-lang/crates.io-index)" = "031d6b53a686f8eef69138f5b834b7eadadb0dd86f4c888504476ee1b17ae8d7"
1843"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 1843"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
1844"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" 1844"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
1845"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" 1845"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9"
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml
index 41672eaff..c50cb8031 100644
--- a/crates/ra_lsp_server/Cargo.toml
+++ b/crates/ra_lsp_server/Cargo.toml
@@ -14,7 +14,7 @@ serde_json = "1.0.34"
14serde = { version = "1.0.83", features = ["derive"] } 14serde = { version = "1.0.83", features = ["derive"] }
15crossbeam-channel = "0.4" 15crossbeam-channel = "0.4"
16log = "0.4.3" 16log = "0.4.3"
17lsp-types = { version = "0.61.0", features = ["proposed"] } 17lsp-types = { version = "0.63.0", features = ["proposed"] }
18rustc-hash = "1.0" 18rustc-hash = "1.0"
19parking_lot = "0.10.0" 19parking_lot = "0.10.0"
20jod-thread = "0.1.0" 20jod-thread = "0.1.0"
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs
index eea0965ed..4cb259360 100644
--- a/crates/ra_lsp_server/src/caps.rs
+++ b/crates/ra_lsp_server/src/caps.rs
@@ -5,7 +5,7 @@ use lsp_types::{
5 DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability, 5 DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability,
6 ImplementationProviderCapability, RenameOptions, RenameProviderCapability, ServerCapabilities, 6 ImplementationProviderCapability, RenameOptions, RenameProviderCapability, ServerCapabilities,
7 SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind, 7 SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind,
8 TextDocumentSyncOptions, TypeDefinitionProviderCapability, 8 TextDocumentSyncOptions, TypeDefinitionProviderCapability, WorkDoneProgressOptions,
9}; 9};
10 10
11pub fn server_capabilities() -> ServerCapabilities { 11pub fn server_capabilities() -> ServerCapabilities {
@@ -21,10 +21,14 @@ pub fn server_capabilities() -> ServerCapabilities {
21 completion_provider: Some(CompletionOptions { 21 completion_provider: Some(CompletionOptions {
22 resolve_provider: None, 22 resolve_provider: None,
23 trigger_characters: Some(vec![":".to_string(), ".".to_string()]), 23 trigger_characters: Some(vec![":".to_string(), ".".to_string()]),
24 work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
24 }), 25 }),
25 signature_help_provider: Some(SignatureHelpOptions { 26 signature_help_provider: Some(SignatureHelpOptions {
26 trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]), 27 trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]),
28 retrigger_characters: None,
29 work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
27 }), 30 }),
31 declaration_provider: None,
28 definition_provider: Some(true), 32 definition_provider: Some(true),
29 type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)), 33 type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)),
30 implementation_provider: Some(ImplementationProviderCapability::Simple(true)), 34 implementation_provider: Some(ImplementationProviderCapability::Simple(true)),
@@ -44,6 +48,7 @@ pub fn server_capabilities() -> ServerCapabilities {
44 folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), 48 folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)),
45 rename_provider: Some(RenameProviderCapability::Options(RenameOptions { 49 rename_provider: Some(RenameProviderCapability::Options(RenameOptions {
46 prepare_provider: Some(true), 50 prepare_provider: Some(true),
51 work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
47 })), 52 })),
48 document_link_provider: None, 53 document_link_provider: None,
49 color_provider: None, 54 color_provider: None,
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 83845f1e0..158cac0be 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -520,7 +520,8 @@ fn on_notification(
520 if let Some(file_id) = state.vfs.write().remove_file_overlay(path.as_path()) { 520 if let Some(file_id) = state.vfs.write().remove_file_overlay(path.as_path()) {
521 subs.remove_sub(FileId(file_id.0)); 521 subs.remove_sub(FileId(file_id.0));
522 } 522 }
523 let params = req::PublishDiagnosticsParams { uri, diagnostics: Vec::new() }; 523 let params =
524 req::PublishDiagnosticsParams { uri, diagnostics: Vec::new(), version: None };
524 let not = notification_new::<req::PublishDiagnostics>(params); 525 let not = notification_new::<req::PublishDiagnostics>(params);
525 msg_sender.send(not.into()).unwrap(); 526 msg_sender.send(not.into()).unwrap();
526 return Ok(()); 527 return Ok(());
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 409583634..5b64b27cd 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -648,6 +648,7 @@ pub fn handle_code_action(
648 diagnostics: None, 648 diagnostics: None,
649 edit: None, 649 edit: None,
650 command: Some(command), 650 command: Some(command),
651 is_preferred: None,
651 }; 652 };
652 res.push(action.into()); 653 res.push(action.into());
653 } 654 }
@@ -670,6 +671,7 @@ pub fn handle_code_action(
670 diagnostics: None, 671 diagnostics: None,
671 edit: None, 672 edit: None,
672 command: Some(command), 673 command: Some(command),
674 is_preferred: None,
673 }; 675 };
674 res.push(action.into()); 676 res.push(action.into());
675 } 677 }
@@ -828,9 +830,10 @@ pub fn publish_diagnostics(
828 source: Some("rust-analyzer".to_string()), 830 source: Some("rust-analyzer".to_string()),
829 message: d.message, 831 message: d.message,
830 related_information: None, 832 related_information: None,
833 tags: None,
831 }) 834 })
832 .collect(); 835 .collect();
833 Ok(req::PublishDiagnosticsParams { uri, diagnostics }) 836 Ok(req::PublishDiagnosticsParams { uri, diagnostics, version: None })
834} 837}
835 838
836pub fn publish_decorations( 839pub fn publish_decorations(
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index cfbf16ea5..dff63a12d 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -4,7 +4,8 @@ use std::{collections::HashMap, time::Instant};
4 4
5use lsp_types::{ 5use lsp_types::{
6 CodeActionContext, DidOpenTextDocumentParams, DocumentFormattingParams, FormattingOptions, 6 CodeActionContext, DidOpenTextDocumentParams, DocumentFormattingParams, FormattingOptions,
7 Position, Range, TextDocumentItem, TextDocumentPositionParams, 7 PartialResultParams, Position, Range, TextDocumentItem, TextDocumentPositionParams,
8 WorkDoneProgressParams,
8}; 9};
9use ra_lsp_server::req::{ 10use ra_lsp_server::req::{
10 CodeActionParams, CodeActionRequest, Completion, CompletionParams, DidOpenTextDocument, 11 CodeActionParams, CodeActionRequest, Completion, CompletionParams, DidOpenTextDocument,
@@ -48,6 +49,8 @@ use std::collections::Spam;
48 Position::new(0, 23), 49 Position::new(0, 23),
49 ), 50 ),
50 context: None, 51 context: None,
52 partial_result_params: PartialResultParams::default(),
53 work_done_progress_params: WorkDoneProgressParams::default(),
51 }); 54 });
52 assert!(format!("{}", res).contains("HashMap")); 55 assert!(format!("{}", res).contains("HashMap"));
53 eprintln!("completion took {:?}", completion_start.elapsed()); 56 eprintln!("completion took {:?}", completion_start.elapsed());
@@ -211,8 +214,12 @@ pub use std::collections::HashMap;
211 options: FormattingOptions { 214 options: FormattingOptions {
212 tab_size: 4, 215 tab_size: 4,
213 insert_spaces: false, 216 insert_spaces: false,
217 insert_final_newline: None,
218 trim_final_newlines: None,
219 trim_trailing_whitespace: None,
214 properties: HashMap::new(), 220 properties: HashMap::new(),
215 }, 221 },
222 work_done_progress_params: WorkDoneProgressParams::default(),
216 }, 223 },
217 json!([ 224 json!([
218 { 225 {
@@ -272,7 +279,11 @@ pub use std::collections::HashMap;
272 tab_size: 4, 279 tab_size: 4,
273 insert_spaces: false, 280 insert_spaces: false,
274 properties: HashMap::new(), 281 properties: HashMap::new(),
282 insert_final_newline: None,
283 trim_final_newlines: None,
284 trim_trailing_whitespace: None,
275 }, 285 },
286 work_done_progress_params: WorkDoneProgressParams::default(),
276 }, 287 },
277 json!([ 288 json!([
278 { 289 {
@@ -325,6 +336,8 @@ fn main() {}
325 text_document: server.doc_id("src/lib.rs"), 336 text_document: server.doc_id("src/lib.rs"),
326 range: Range::new(Position::new(0, 4), Position::new(0, 7)), 337 range: Range::new(Position::new(0, 4), Position::new(0, 7)),
327 context: empty_context(), 338 context: empty_context(),
339 partial_result_params: PartialResultParams::default(),
340 work_done_progress_params: WorkDoneProgressParams::default(),
328 }, 341 },
329 json!([ 342 json!([
330 { 343 {
@@ -356,6 +369,8 @@ fn main() {}
356 text_document: server.doc_id("src/lib.rs"), 369 text_document: server.doc_id("src/lib.rs"),
357 range: Range::new(Position::new(2, 4), Position::new(2, 7)), 370 range: Range::new(Position::new(2, 4), Position::new(2, 7)),
358 context: empty_context(), 371 context: empty_context(),
372 partial_result_params: PartialResultParams::default(),
373 work_done_progress_params: WorkDoneProgressParams::default(),
359 }, 374 },
360 json!([]), 375 json!([]),
361 ); 376 );
@@ -404,6 +419,8 @@ fn main() {{}}
404 text_document: server.doc_id("src/lib.rs"), 419 text_document: server.doc_id("src/lib.rs"),
405 range: Range::new(Position::new(0, 4), Position::new(0, 7)), 420 range: Range::new(Position::new(0, 4), Position::new(0, 7)),
406 context: empty_context(), 421 context: empty_context(),
422 partial_result_params: PartialResultParams::default(),
423 work_done_progress_params: WorkDoneProgressParams::default(),
407 }, 424 },
408 json!([ 425 json!([
409 { 426 {
@@ -435,6 +452,8 @@ fn main() {{}}
435 text_document: server.doc_id("src/lib.rs"), 452 text_document: server.doc_id("src/lib.rs"),
436 range: Range::new(Position::new(2, 4), Position::new(2, 7)), 453 range: Range::new(Position::new(2, 4), Position::new(2, 7)),
437 context: empty_context(), 454 context: empty_context(),
455 partial_result_params: PartialResultParams::default(),
456 work_done_progress_params: WorkDoneProgressParams::default(),
438 }, 457 },
439 json!([]), 458 json!([]),
440 ); 459 );
diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts
index 9e4ce0eb3..2777ced24 100644
--- a/editors/code/src/commands/analyzer_status.ts
+++ b/editors/code/src/commands/analyzer_status.ts
@@ -9,7 +9,7 @@ export class TextDocumentContentProvider
9 public syntaxTree: string = 'Not available'; 9 public syntaxTree: string = 'Not available';
10 10
11 public provideTextDocumentContent( 11 public provideTextDocumentContent(
12 uri: vscode.Uri, 12 _uri: vscode.Uri,
13 ): vscode.ProviderResult<string> { 13 ): vscode.ProviderResult<string> {
14 const editor = vscode.window.activeTextEditor; 14 const editor = vscode.window.activeTextEditor;
15 if (editor == null) { 15 if (editor == null) {
diff --git a/editors/code/src/commands/expand_macro.ts b/editors/code/src/commands/expand_macro.ts
index 842898020..17c78280a 100644
--- a/editors/code/src/commands/expand_macro.ts
+++ b/editors/code/src/commands/expand_macro.ts
@@ -11,7 +11,7 @@ export class ExpandMacroContentProvider
11 public eventEmitter = new vscode.EventEmitter<vscode.Uri>(); 11 public eventEmitter = new vscode.EventEmitter<vscode.Uri>();
12 12
13 public provideTextDocumentContent( 13 public provideTextDocumentContent(
14 uri: vscode.Uri, 14 _uri: vscode.Uri,
15 ): vscode.ProviderResult<string> { 15 ): vscode.ProviderResult<string> {
16 async function handle() { 16 async function handle() {
17 const editor = vscode.window.activeTextEditor; 17 const editor = vscode.window.activeTextEditor;
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index 9b1c6643d..cf980e257 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -73,7 +73,7 @@ function createTask(spec: Runnable): vscode.Task {
73} 73}
74 74
75let prevRunnable: RunnableQuickPick | undefined; 75let prevRunnable: RunnableQuickPick | undefined;
76export async function handle() { 76export async function handle(): Promise<vscode.TaskExecution | undefined> {
77 const editor = vscode.window.activeTextEditor; 77 const editor = vscode.window.activeTextEditor;
78 if (editor == null || editor.document.languageId !== 'rust') { 78 if (editor == null || editor.document.languageId !== 'rust') {
79 return; 79 return;
@@ -105,12 +105,14 @@ export async function handle() {
105 items.push(new RunnableQuickPick(r)); 105 items.push(new RunnableQuickPick(r));
106 } 106 }
107 const item = await vscode.window.showQuickPick(items); 107 const item = await vscode.window.showQuickPick(items);
108 if (item) { 108 if (!item) {
109 item.detail = 'rerun'; 109 return;
110 prevRunnable = item;
111 const task = createTask(item.runnable);
112 return await vscode.tasks.executeTask(task);
113 } 110 }
111
112 item.detail = 'rerun';
113 prevRunnable = item;
114 const task = createTask(item.runnable);
115 return await vscode.tasks.executeTask(task);
114} 116}
115 117
116export async function handleSingle(runnable: Runnable) { 118export async function handleSingle(runnable: Runnable) {
@@ -178,7 +180,7 @@ export async function startCargoWatch(
178 } 180 }
179 181
180 const label = 'install-cargo-watch'; 182 const label = 'install-cargo-watch';
181 const taskFinished = new Promise((resolve, reject) => { 183 const taskFinished = new Promise((resolve, _reject) => {
182 const disposable = vscode.tasks.onDidEndTask(({ execution }) => { 184 const disposable = vscode.tasks.onDidEndTask(({ execution }) => {
183 if (execution.task.name === label) { 185 if (execution.task.name === label) {
184 disposable.dispose(); 186 disposable.dispose();
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts
index 96ec8c614..2b25eb705 100644
--- a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts
+++ b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts
@@ -114,7 +114,8 @@ describe('SuggestedFix', () => {
114 114
115 const edit = codeAction.edit; 115 const edit = codeAction.edit;
116 if (!edit) { 116 if (!edit) {
117 return assert.fail('Code Action edit unexpectedly missing'); 117 assert.fail('Code Action edit unexpectedly missing');
118 return;
118 } 119 }
119 120
120 const editEntries = edit.entries(); 121 const editEntries = edit.entries();
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts
index 4c1467b57..ef09013f4 100644
--- a/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts
+++ b/editors/code/src/test/utils/diagnotics/SuggestedFixCollection.test.ts
@@ -53,7 +53,8 @@ describe('SuggestedFixCollection', () => {
53 53
54 const { diagnostics } = codeAction; 54 const { diagnostics } = codeAction;
55 if (!diagnostics) { 55 if (!diagnostics) {
56 return assert.fail('Diagnostics unexpectedly missing'); 56 assert.fail('Diagnostics unexpectedly missing');
57 return;
57 } 58 }
58 59
59 assert.strictEqual(diagnostics.length, 1); 60 assert.strictEqual(diagnostics.length, 1);
@@ -114,7 +115,8 @@ describe('SuggestedFixCollection', () => {
114 const { diagnostics } = codeAction; 115 const { diagnostics } = codeAction;
115 116
116 if (!diagnostics) { 117 if (!diagnostics) {
117 return assert.fail('Diagnostics unexpectedly missing'); 118 assert.fail('Diagnostics unexpectedly missing');
119 return;
118 } 120 }
119 121
120 // We should be associated with both diagnostics 122 // We should be associated with both diagnostics
diff --git a/editors/code/src/test/utils/diagnotics/rust.test.ts b/editors/code/src/test/utils/diagnotics/rust.test.ts
index cee59061f..0222dbbaa 100644
--- a/editors/code/src/test/utils/diagnotics/rust.test.ts
+++ b/editors/code/src/test/utils/diagnotics/rust.test.ts
@@ -120,7 +120,8 @@ describe('mapRustDiagnosticToVsCode', () => {
120 // One related information for the original definition 120 // One related information for the original definition
121 const relatedInformation = diagnostic.relatedInformation; 121 const relatedInformation = diagnostic.relatedInformation;
122 if (!relatedInformation) { 122 if (!relatedInformation) {
123 return assert.fail('Related information unexpectedly undefined'); 123 assert.fail('Related information unexpectedly undefined');
124 return;
124 } 125 }
125 assert.strictEqual(relatedInformation.length, 1); 126 assert.strictEqual(relatedInformation.length, 1);
126 const [related] = relatedInformation; 127 const [related] = relatedInformation;
@@ -154,7 +155,8 @@ describe('mapRustDiagnosticToVsCode', () => {
154 // One related information for the lint definition 155 // One related information for the lint definition
155 const relatedInformation = diagnostic.relatedInformation; 156 const relatedInformation = diagnostic.relatedInformation;
156 if (!relatedInformation) { 157 if (!relatedInformation) {
157 return assert.fail('Related information unexpectedly undefined'); 158 assert.fail('Related information unexpectedly undefined');
159 return;
158 } 160 }
159 assert.strictEqual(relatedInformation.length, 1); 161 assert.strictEqual(relatedInformation.length, 1);
160 const [related] = relatedInformation; 162 const [related] = relatedInformation;
diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json
index 9ad2e967b..5e11c3775 100644
--- a/editors/code/tsconfig.json
+++ b/editors/code/tsconfig.json
@@ -1,13 +1,16 @@
1{ 1{
2 "compilerOptions": { 2 "compilerOptions": {
3 "module": "commonjs", 3 "module": "commonjs",
4 "target": "es6", 4 "target": "es2018",
5 "outDir": "out", 5 "outDir": "out",
6 "lib": ["es6"], 6 "lib": ["es2018"],
7 "sourceMap": true, 7 "sourceMap": true,
8 "rootDir": "src", 8 "rootDir": "src",
9 "strict": true, 9 "strict": true,
10 "noUnusedLocals": true 10 "noUnusedLocals": true,
11 "noUnusedParameters": true,
12 "noImplicitReturns": true,
13 "noFallthroughCasesInSwitch": true
11 }, 14 },
12 "exclude": ["node_modules", ".vscode-test"] 15 "exclude": ["node_modules", ".vscode-test"]
13} 16}
diff --git a/editors/code/tslint.json b/editors/code/tslint.json
index bdeb4895e..b69c5574d 100644
--- a/editors/code/tslint.json
+++ b/editors/code/tslint.json
@@ -4,6 +4,8 @@
4 "rules": { 4 "rules": {
5 "quotemark": [true, "single"], 5 "quotemark": [true, "single"],
6 "interface-name": false, 6 "interface-name": false,
7 "object-literal-sort-keys": false 7 "object-literal-sort-keys": false,
8 // Allow `_bar` to sort with tsc's `noUnusedParameters` option
9 "variable-name": [true, "allow-leading-underscore"]
8 } 10 }
9} 11}