}
let prevRunnable: RunnableQuickPick | undefined;
-export async function handle() {
+export async function handle(): Promise<vscode.TaskExecution | undefined> {
const editor = vscode.window.activeTextEditor;
if (editor == null || editor.document.languageId !== 'rust') {
return;
items.push(new RunnableQuickPick(r));
}
const item = await vscode.window.showQuickPick(items);
- if (item) {
- item.detail = 'rerun';
- prevRunnable = item;
- const task = createTask(item.runnable);
- return await vscode.tasks.executeTask(task);
+ if (!item) {
+ return;
}
+
+ item.detail = 'rerun';
+ prevRunnable = item;
+ const task = createTask(item.runnable);
+ return await vscode.tasks.executeTask(task);
}
export async function handleSingle(runnable: Runnable) {
const edit = codeAction.edit;
if (!edit) {
- return assert.fail('Code Action edit unexpectedly missing');
+ assert.fail('Code Action edit unexpectedly missing');
+ return;
}
const editEntries = edit.entries();
const { diagnostics } = codeAction;
if (!diagnostics) {
- return assert.fail('Diagnostics unexpectedly missing');
+ assert.fail('Diagnostics unexpectedly missing');
+ return;
}
assert.strictEqual(diagnostics.length, 1);
const { diagnostics } = codeAction;
if (!diagnostics) {
- return assert.fail('Diagnostics unexpectedly missing');
+ assert.fail('Diagnostics unexpectedly missing');
+ return;
}
// We should be associated with both diagnostics
// One related information for the original definition
const relatedInformation = diagnostic.relatedInformation;
if (!relatedInformation) {
- return assert.fail('Related information unexpectedly undefined');
+ assert.fail('Related information unexpectedly undefined');
+ return;
}
assert.strictEqual(relatedInformation.length, 1);
const [related] = relatedInformation;
// One related information for the lint definition
const relatedInformation = diagnostic.relatedInformation;
if (!relatedInformation) {
- return assert.fail('Related information unexpectedly undefined');
+ assert.fail('Related information unexpectedly undefined');
+ return;
}
assert.strictEqual(relatedInformation.length, 1);
const [related] = relatedInformation;
"rootDir": "src",
"strict": true,
"noUnusedLocals": true,
- "noUnusedParameters": true
+ "noUnusedParameters": true,
+ "noImplicitReturns": true
},
"exclude": ["node_modules", ".vscode-test"]
}