Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 8b3fd40

Browse files
committed
Simplify commands using question mark operator since TS upgrade
1 parent ac97f68 commit 8b3fd40

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

src/extension.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -475,27 +475,17 @@ const activeWorkspace = new Observable<ClientWorkspace | null>(null);
475475
*/
476476
function registerCommands(): Disposable[] {
477477
return [
478-
commands.registerCommand(
479-
'rls.update',
480-
() => activeWorkspace.value && activeWorkspace.value.rustupUpdate(),
478+
commands.registerCommand('rls.update', () =>
479+
activeWorkspace.value?.rustupUpdate(),
481480
),
482-
commands.registerCommand(
483-
'rls.restart',
484-
async () => activeWorkspace.value && activeWorkspace.value.restart(),
481+
commands.registerCommand('rls.restart', async () =>
482+
activeWorkspace.value?.restart(),
485483
),
486-
commands.registerCommand(
487-
'rls.run',
488-
(cmd: Execution) =>
489-
activeWorkspace.value && activeWorkspace.value.runRlsCommand(cmd),
490-
),
491-
commands.registerCommand(
492-
'rls.start',
493-
() => activeWorkspace.value && activeWorkspace.value.start(),
494-
),
495-
commands.registerCommand(
496-
'rls.stop',
497-
() => activeWorkspace.value && activeWorkspace.value.stop(),
484+
commands.registerCommand('rls.run', (cmd: Execution) =>
485+
activeWorkspace.value?.runRlsCommand(cmd),
498486
),
487+
commands.registerCommand('rls.start', () => activeWorkspace.value?.start()),
488+
commands.registerCommand('rls.stop', () => activeWorkspace.value?.stop()),
499489
];
500490
}
501491

0 commit comments

Comments
 (0)