diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-11 16:14:41 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-11 16:14:41 +0000 |
commit | 797a6c3041f2d06d68267232e312302bb59932a3 (patch) | |
tree | 8ecd119d1595aa61c9b3076e285eb71371930e10 /editors/code/src/commands | |
parent | 143484922284b2b3177393706ba27c76a3113292 (diff) | |
parent | f0f259bda32a3cf04f45cea946b5d12368454342 (diff) |
Merge #2527
2527: Enable tsc builtin lint options for vscode/extension r=matklad a=saneyuki
* These options are not enabled by `--strict` option and these options make a code more solid.
* https://www.typescriptlang.org/docs/handbook/compiler-options.html
* For `noUnusedParameters` , we need to tweak tslint option to allow `_bar` style.
Co-authored-by: Tetsuharu OHZEKI <[email protected]>
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/analyzer_status.ts | 2 | ||||
-rw-r--r-- | editors/code/src/commands/expand_macro.ts | 2 | ||||
-rw-r--r-- | editors/code/src/commands/runnables.ts | 16 |
3 files changed, 11 insertions, 9 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(); |