diff --git a/browser/src/Services/QuickOpen/QuickOpen.ts b/browser/src/Services/QuickOpen/QuickOpen.ts index 6b2d5e4fe5..94fcd3d609 100644 --- a/browser/src/Services/QuickOpen/QuickOpen.ts +++ b/browser/src/Services/QuickOpen/QuickOpen.ts @@ -290,9 +290,13 @@ export class QuickOpen { const file = path.basename(f) const folder = path.dirname(f) const pinned = this._seenItems.indexOf(f) >= 0 + const icon = + QuickOpenItem.convertIconToType(qitem.icon) !== QuickOpenType.file + ? qitem.icon + : (getFileIcon(file) as any) return { - icon: getFileIcon(file) as any, + icon, label: file, detail: folder, pinned, diff --git a/browser/src/Services/QuickOpen/QuickOpenItem.ts b/browser/src/Services/QuickOpen/QuickOpenItem.ts index 6a57b23920..795f46e9f8 100644 --- a/browser/src/Services/QuickOpen/QuickOpenItem.ts +++ b/browser/src/Services/QuickOpen/QuickOpenItem.ts @@ -8,6 +8,7 @@ export enum QuickOpenType { folder, folderHelp, bufferLine, + unknown, } // Wrapper around quick open items, this not only allows us to show multiple icons @@ -33,6 +34,25 @@ export class QuickOpenItem { } } + public static convertIconToType(icon: string): QuickOpenType { + switch (icon) { + case "star-o": + return QuickOpenType.bookmark + case "info": + return QuickOpenType.bookmarkHelp + case "file-text-o": + return QuickOpenType.file + case "folder-o": + return QuickOpenType.folder + case "folder-open-o": + return QuickOpenType.folderHelp + case "angle-right": + return QuickOpenType.bufferLine + default: + return QuickOpenType.unknown + } + } + // Each has an item, and an icon private _item: string private _icon: string diff --git a/browser/src/Services/Workspace/WorkspaceCommands.ts b/browser/src/Services/Workspace/WorkspaceCommands.ts index 69c0a1a203..01a2708efc 100644 --- a/browser/src/Services/Workspace/WorkspaceCommands.ts +++ b/browser/src/Services/Workspace/WorkspaceCommands.ts @@ -69,6 +69,11 @@ export const activateCommands = ( return null } + // If we have no active workspace, we don't know where test files live. + if (!workspace.activeWorkspace) { + return null + } + const currentEditor = editorManager.activeEditor if (!currentEditor || !currentEditor.activeBuffer) {