diff options
author | Benjamin Pasero <benjpas@microsoft.com> | 2020-11-25 11:59:49 +0300 |
---|---|---|
committer | Benjamin Pasero <benjpas@microsoft.com> | 2020-11-25 11:59:55 +0300 |
commit | 96b2c670d7e484ab860fa9dde8e042b4ad83687b (patch) | |
tree | ca1a358a36da69ed21fe0af8e1ffbc8e90ffdec3 /src/vs/workbench/contrib/extensions/electron-sandbox | |
parent | ffec932655b672f1b11f6db1696c9460d1f92eb3 (diff) |
debt - extensions path is always defined
Diffstat (limited to 'src/vs/workbench/contrib/extensions/electron-sandbox')
-rw-r--r-- | src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts index 369d6a1bf0b..99cd8d052d8 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts @@ -27,20 +27,18 @@ export class OpenExtensionsFolderAction extends Action { } async run(): Promise<void> { - if (this.environmentService.extensionsPath) { - const extensionsHome = URI.file(this.environmentService.extensionsPath); - const file = await this.fileService.resolve(extensionsHome); - - let itemToShow: URI; - if (file.children && file.children.length > 0) { - itemToShow = file.children[0].resource; - } else { - itemToShow = extensionsHome; - } - - if (itemToShow.scheme === Schemas.file) { - return this.nativeHostService.showItemInFolder(itemToShow.fsPath); - } + const extensionsHome = URI.file(this.environmentService.extensionsPath); + const file = await this.fileService.resolve(extensionsHome); + + let itemToShow: URI; + if (file.children && file.children.length > 0) { + itemToShow = file.children[0].resource; + } else { + itemToShow = extensionsHome; + } + + if (itemToShow.scheme === Schemas.file) { + return this.nativeHostService.showItemInFolder(itemToShow.fsPath); } } } |