Last active
June 18, 2021 18:32
-
-
Save sweeneyapps/ecc67271f9342789c3ade46a0921826e to your computer and use it in GitHub Desktop.
fixing TypeScript error (before and after)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before fixing TypeScript errors | |
public static registerCommand(context: vscode.ExtensionContext): vscode.Disposable { | |
const commands = vscode.commands.registerCommand(this.viewType, async () => { | |
// file chooser | |
let uri: vscode.Uri | undefined = await vscode.window.showOpenDialog() | |
this.createOrShow(uri[0]); | |
}); | |
return commands; | |
} | |
// Fixed TypeScript error | |
public static registerCommand(context: vscode.ExtensionContext): vscode.Disposable { | |
const commands = vscode.commands.registerCommand(this.viewType, async () => { | |
// file chooser | |
let uri: vscode.Uri[] | undefined = await vscode.window.showOpenDialog() | |
if (uri) this.createOrShow(uri[0]); | |
}); | |
return commands; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment