Merge from vscode 709a07d51919d3266ca71699c6ddfb2d3547c0e1 (#6575)

This commit is contained in:
Chris LaFreniere
2019-08-02 21:06:44 -07:00
committed by GitHub
parent 402b50c03b
commit 62d2fb534d
103 changed files with 726 additions and 374 deletions

View File

@@ -213,37 +213,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
}
});
CommandsRegistry.registerCommand({
id: Constants.RevealInSideBarForSearchResults,
handler: (accessor, fileMatch: FileMatch) => {
const viewletService = accessor.get(IViewletService);
const explorerService = accessor.get(IExplorerService);
const contextService = accessor.get(IWorkspaceContextService);
const uri = fileMatch.resource;
viewletService.openViewlet(VIEWLET_ID_FILES, false).then((viewlet: ExplorerViewlet) => {
if (uri && contextService.isInsideWorkspace(uri)) {
const explorerView = viewlet.getExplorerView();
if (explorerView) {
explorerView.setExpanded(true);
explorerService.select(uri, true).then(() => explorerView.focus(), onUnexpectedError);
}
}
});
}
});
const RevealInSideBarForSearchResultsCommand: ICommandAction = {
id: Constants.RevealInSideBarForSearchResults,
title: nls.localize('revealInSideBar', "Reveal in Explorer")
};
MenuRegistry.appendMenuItem(MenuId.SearchContext, {
command: RevealInSideBarForSearchResultsCommand,
when: ContextKeyExpr.and(Constants.FileFocusKey, Constants.HasSearchResults),
group: '2_files',
});
MenuRegistry.appendMenuItem(MenuId.SearchContext, {
command: {
id: Constants.ReplaceActionId,
@@ -343,6 +312,38 @@ CommandsRegistry.registerCommand({
handler: clearHistoryCommand
});
CommandsRegistry.registerCommand({
id: Constants.RevealInSideBarForSearchResults,
handler: (accessor, fileMatch: FileMatch) => {
const viewletService = accessor.get(IViewletService);
const explorerService = accessor.get(IExplorerService);
const contextService = accessor.get(IWorkspaceContextService);
const uri = fileMatch.resource;
viewletService.openViewlet(VIEWLET_ID_FILES, false).then((viewlet: ExplorerViewlet) => {
if (uri && contextService.isInsideWorkspace(uri)) {
const explorerView = viewlet.getExplorerView();
if (explorerView) {
explorerView.setExpanded(true);
explorerService.select(uri, true).then(() => explorerView.focus(), onUnexpectedError);
}
}
});
}
});
const RevealInSideBarForSearchResultsCommand: ICommandAction = {
id: Constants.RevealInSideBarForSearchResults,
title: nls.localize('revealInSideBar', "Reveal in Explorer")
};
MenuRegistry.appendMenuItem(MenuId.SearchContext, {
command: RevealInSideBarForSearchResultsCommand,
when: ContextKeyExpr.and(Constants.FileFocusKey, Constants.HasSearchResults),
group: 'search_3',
order: 1
});
const clearSearchHistoryLabel = nls.localize('clearSearchHistoryLabel', "Clear Search History");
const ClearSearchHistoryCommand: ICommandAction = {
id: Constants.ClearSearchHistoryCommandId,