Repository navigation
Add terminal quick picker - #30968
Conversation
|
Amy Qiu (@Lixire), thanks for your PR! By analyzing the history of the files in this pull request, we identified Daniel Imms (@Tyriar) and Benjamin Pasero (@bpasero) to be potential reviewers. |
| 'TerminalPickerHandler', | ||
| 'term ', | ||
| 'inTerminalPicker', | ||
| nls.localize('quickOpen.terminal', "Quickpick Terminal") |
There was a problem hiding this comment.
I think this is what shows up when you use ? in quickopen, so maybe something like "Open terminal"?
There was a problem hiding this comment.
"Show All Opened Terminals" would be consistent with the editor one: "Show All Opened Editors"
|
This looks awesome! |
| import 'vs/css!./media/terminal'; | ||
| import 'vs/css!./media/xterm'; | ||
| import 'vs/css!./media/widgets'; | ||
| import 'vs/workbench/parts/terminal/browser/terminalQuickOpen'; |
There was a problem hiding this comment.
I think you want to move this to workbench.main.ts
| 'TerminalPickerHandler', | ||
| 'term ', | ||
| 'inTerminalPicker', | ||
| nls.localize('quickOpen.terminal', "Quickpick Terminal") |
There was a problem hiding this comment.
"Show All Opened Terminals" would be consistent with the editor one: "Show All Opened Editors"
| new QuickOpenHandlerDescriptor( | ||
| 'vs/workbench/parts/terminal/browser/terminalQuickOpen', | ||
| 'TerminalPickerHandler', | ||
| 'term ', |
There was a problem hiding this comment.
| 'vs/workbench/parts/terminal/browser/terminalQuickOpen', | ||
| 'TerminalPickerHandler', | ||
| 'term ', | ||
| 'inTerminalPicker', |
There was a problem hiding this comment.
Point to the actual source of the context key string as in https://github.com/Microsoft/vscode/blob/b357df0707e36430b66cfb8dac35c9872eaae290/src/vs/workbench/browser/parts/editor/editor.contribution.ts#L312
|
|
||
|
|
||
| }); | ||
| return termninalEntries.concat(taskEntries); |
There was a problem hiding this comment.
Concerned about the inconsistency of how the terminal select dropdown is sequential but the quick open is out of order due to terminal/task separation. Why not keep the exact same naming structure as the dropdown?
There was a problem hiding this comment.
Part of me likes this since the original idea was that mixing user terminals and task terminals together is confusing. What if they were separated in the dropdown?
There was a problem hiding this comment.
But then maybe "next terminal" and "previous terminal" are confusing if they don't work by when the terminal was created, or if their order doesn't match the dropdown order?
There was a problem hiding this comment.
Yeah right now they're numbered in the order in which they were created, and that influences the next/prev terminal commands.
|
|
||
| public getAutoFocus(searchValue: string, context: { model: IModel<QuickOpenEntry>, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { | ||
| return { | ||
| autoFocusFirstEntry: !!searchValue || !!context.quickNavigateConfiguration |
There was a problem hiding this comment.
This can just be: searchValue || context.quickNavigateConfiguration
There was a problem hiding this comment.
They can't be assigned as a boolean though
| e.setGroupLabel(lastCategory); | ||
| } else { | ||
| e.setShowBorder(false); | ||
| e.setGroupLabel(void 0); |
There was a problem hiding this comment.
Setting this to void 0 looks a bit weird, let's just use null.
There was a problem hiding this comment.
I don't know why people use void 0 instead of undefined so much in our codebase
There was a problem hiding this comment.
I mainly just use it for void promises as it looks better imo.
| return TPromise.as(new QuickOpenModel(entries)); | ||
| } | ||
|
|
||
| private getTerminals(): TerminalEntry[] { |
There was a problem hiding this comment.
Is the plan when tasks go into a new panel to create one of these specifically for tasks? Or will they be merged into the existing 'task ' one or something?
| private category: string, | ||
| private open: () => void | ||
| ) { | ||
| super(); |
There was a problem hiding this comment.
I think this is redundant?
| import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; | ||
| import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; | ||
|
|
||
| export const TERMINAL_PICKER_PREFIX = 'term '; |
There was a problem hiding this comment.
Move to terminal.ts as it should be shared
| terminals.forEach((terminal, index) => { | ||
| const terminalsCategory = nls.localize('terminals', "Terminal"); | ||
| const taskCategory = nls.localize('task', "Task"); | ||
| if (terminal.title.indexOf('Task') >= 0) { |
There was a problem hiding this comment.
Is there a better way to tell whether a terminal belongs to the task runner?
There was a problem hiding this comment.
Not that I know of
There was a problem hiding this comment.
I can just not do the categories for now
| const termninalEntries: TerminalEntry[] = []; | ||
| const terminals = this.terminalService.getInstanceLabels(); | ||
|
|
||
| terminals.forEach((terminal, index) => { |
There was a problem hiding this comment.
terminalEntries = terminals.map(terminal => {
...
return new TerminalEntry(...);
});
fa39449 to
3a184ab
Compare
term␣in quick picker, you get a list of active terminalsThis is like viewPickerHandler, but only for terminal.
Addresses #29879 . Doesn't have a command attached to it yet for a keybinding.