-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#28617 - implemented according to comments in PR #28952
Changes from all commits
77751c9
c2134a2
2cd6f12
7c5078e
ebd7bb0
10ff9cb
cd6c611
b2d9137
1e98f71
c1626a7
be27e6b
0f20e2e
f16860f
02d5a9d
ee650e6
ce7b823
244df43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands'; | |
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; | ||
import URI from 'vs/base/common/uri'; | ||
import { IEditorOptions, Position as EditorPosition } from 'vs/platform/editor/common/editor'; | ||
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; | ||
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; | ||
|
||
// --- List Commands | ||
|
||
|
@@ -421,3 +423,28 @@ export function registerCommands(): void { | |
}); | ||
}); | ||
} | ||
|
||
namespace GlobalQuickOpenCommand { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cristianhosu while this adds the command, it no longer shows up in the F1 command palette. @jrieken didn't we add support to contribute commands to the F1 list recently? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is support for this, i'll add it to F1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cristianhosu looks like currently we are not using this explicitly but this test shows how to add a command to the F1 list: https://github.com/Microsoft/vscode/blob/master/src/vs/platform/actions/test/common/menuService.test.ts#L192 Can you add this? |
||
export const ID = 'workbench.action.quickOpen'; | ||
export const LABEL = nls.localize('quickOpen', "Go to File..."); | ||
|
||
CommandsRegistry.registerCommand(ID, function (accessor: ServicesAccessor, args: [string]) { | ||
const quickOpenService = accessor.get(IQuickOpenService); | ||
const [prefix] = args; | ||
|
||
return quickOpenService.show(prefix).then(() => { | ||
return void 0; | ||
}); | ||
}); | ||
|
||
KeybindingsRegistry.registerKeybindingRule({ | ||
id: 'workbench.action.quickOpen', | ||
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), | ||
when: undefined, | ||
primary: KeyMod.CtrlCmd | KeyCode.KEY_P | ||
}); | ||
|
||
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { | ||
command: { id: ID, title: LABEL } | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ import * as nls from 'vs/nls'; | |
import * as panel from 'vs/workbench/browser/panel'; | ||
import * as platform from 'vs/base/common/platform'; | ||
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; | ||
import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not remove this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It had a reference to the Action. As I removed the action, this had to be removed as well |
||
import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TerminalCursorStyle } from 'vs/workbench/parts/terminal/common/terminal'; | ||
import { TERMINAL_DEFAULT_SHELL_LINUX, TERMINAL_DEFAULT_SHELL_OSX, TERMINAL_DEFAULT_SHELL_WINDOWS } from 'vs/workbench/parts/terminal/electron-browser/terminal'; | ||
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; | ||
|
@@ -148,7 +147,6 @@ configurationRegistry.registerConfiguration({ | |
'default': [ | ||
ToggleTabFocusModeAction.ID, | ||
FocusActiveGroupAction.ID, | ||
GlobalQuickOpenAction.ID, | ||
ShowAllCommandsAction.ID, | ||
CreateNewTerminalAction.ID, | ||
CopyTerminalSelectionAction.ID, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace | |
import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It had a reference to the Action. As I removed the action, this had to be removed as well |
||
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; | ||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; | ||
import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen'; | ||
import { OpenRecentAction } from 'vs/workbench/electron-browser/actions'; | ||
import { GlobalNewUntitledFileAction, OpenFileAction } from 'vs/workbench/parts/files/browser/fileActions'; | ||
import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions'; | ||
|
@@ -39,10 +38,6 @@ const showCommands: WatermarkEntry = { | |
text: nls.localize('watermark.showCommands', "Show All Commands"), | ||
ids: [ShowAllCommandsAction.ID] | ||
}; | ||
const quickOpen: WatermarkEntry = { | ||
text: nls.localize('watermark.quickOpen', "Go to File"), | ||
ids: [GlobalQuickOpenAction.ID] | ||
}; | ||
const openFileNonMacOnly: WatermarkEntry = { | ||
text: nls.localize('watermark.openFile', "Open File"), | ||
ids: [OpenFileAction.ID], | ||
|
@@ -80,6 +75,10 @@ const startDebugging: WatermarkEntry = { | |
text: nls.localize('watermark.startDebugging', "Start Debugging"), | ||
ids: [StartAction.ID] | ||
}; | ||
const quickOpen: WatermarkEntry = { | ||
text: nls.localize('workbench.action.quickOpen', "Quick Open"), | ||
ids: ['workbench.action.quickOpen'] | ||
}; | ||
|
||
const noFolderEntries = [ | ||
showCommands, | ||
|
@@ -88,12 +87,12 @@ const noFolderEntries = [ | |
openFileOrFolderMacOnly, | ||
openRecent, | ||
newUntitledFileMacOnly, | ||
toggleTerminal | ||
toggleTerminal, | ||
quickOpen | ||
]; | ||
|
||
const folderEntries = [ | ||
showCommands, | ||
quickOpen, | ||
findInFiles, | ||
startDebugging, | ||
toggleTerminal | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the
namespace GlobalQuickOpenCommand
here, not sure why we would want it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrieken please validate this with @bpasero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bpasero that makes this change smaller because
GlobalQuickOpenCommand.ID
is used here and there