diff options
Diffstat (limited to 'editors/code/src')
4 files changed, 18 insertions, 11 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index c81d7ce0f..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) { |
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; |