Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion browser/src/Services/QuickOpen/QuickOpen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 20 additions & 0 deletions browser/src/Services/QuickOpen/QuickOpenItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions browser/src/Services/Workspace/WorkspaceCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down