diff options
Diffstat (limited to 'editors/code/src')
6 files changed, 21 insertions, 14 deletions
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 | ||
75 | let prevRunnable: RunnableQuickPick | undefined; | 75 | let prevRunnable: RunnableQuickPick | undefined; |
76 | export async function handle() { | 76 | export 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 | ||
116 | export async function handleSingle(runnable: Runnable) { | 118 | export 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; |