Skip to content

Commit

Permalink
Enable Search Editors by default on OSS/Insiders
Browse files Browse the repository at this point in the history
Replace "open results in editor" viewlet action with "open new editor"
  • Loading branch information
Jackson Kearl committed Jan 23, 2020
1 parent f38c500 commit 5a1b063
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import { SearchEditorInput, SearchEditorInputFactory, SearchEditorContribution }
import { SearchEditor } from 'vs/workbench/contrib/search/browser/searchEditor';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
import product from 'vs/platform/product/common/product';

registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true);
registerSingleton(ISearchHistoryService, SearchHistoryService, true);
Expand Down Expand Up @@ -854,7 +855,7 @@ configurationRegistry.registerConfiguration({
},
'search.enableSearchEditorPreview': {
type: 'boolean',
default: false,
default: product.quality !== 'stable',
description: nls.localize('search.enableSearchEditorPreview', "Experimental: When enabled, allows opening workspace search results in an editor.")
},
'search.searchEditorPreview.doubleClickBehaviour': {
Expand Down
6 changes: 5 additions & 1 deletion src/vs/workbench/contrib/search/browser/searchActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ export class OpenSearchEditorAction extends Action {
@IConfigurationService private configurationService: IConfigurationService,
@IInstantiationService private readonly instantiationService: IInstantiationService,
) {
super(id, label);
super(id, label, 'codicon-new-file');
}

update() {
// pass
}

get enabled(): boolean {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { OpenFileFolderAction, OpenFolderAction } from 'vs/workbench/browser/act
import { ResourceLabels } from 'vs/workbench/browser/labels';
import { IEditor } from 'vs/workbench/common/editor';
import { ExcludePatternInputWidget, PatternInputWidget } from 'vs/workbench/contrib/search/browser/patternInputWidget';
import { CancelSearchAction, ClearSearchResultsAction, CollapseDeepestExpandedLevelAction, RefreshAction, IFindInFilesArgs, OpenResultsInEditorAction, appendKeyBindingLabel, ExpandAllAction, ToggleCollapseAndExpandAction } from 'vs/workbench/contrib/search/browser/searchActions';
import { CancelSearchAction, ClearSearchResultsAction, CollapseDeepestExpandedLevelAction, RefreshAction, IFindInFilesArgs, OpenSearchEditorAction, appendKeyBindingLabel, ExpandAllAction, ToggleCollapseAndExpandAction } from 'vs/workbench/contrib/search/browser/searchActions';
import { FileMatchRenderer, FolderMatchRenderer, MatchRenderer, SearchAccessibilityProvider, SearchDelegate, SearchDND } from 'vs/workbench/contrib/search/browser/searchResultsView';
import { ISearchWidgetOptions, SearchWidget } from 'vs/workbench/contrib/search/browser/searchWidget';
import * as Constants from 'vs/workbench/contrib/search/common/constants';
Expand Down Expand Up @@ -114,7 +114,7 @@ export class SearchView extends ViewPane {

private state: SearchUIState = SearchUIState.Idle;

private actions: Array<CollapseDeepestExpandedLevelAction | ClearSearchResultsAction | OpenResultsInEditorAction> = [];
private actions: Array<CollapseDeepestExpandedLevelAction | ClearSearchResultsAction | OpenSearchEditorAction> = [];
private toggleCollapseAction: ToggleCollapseAndExpandAction;
private cancelAction: CancelSearchAction;
private refreshAction: RefreshAction;
Expand Down Expand Up @@ -232,7 +232,7 @@ export class SearchView extends ViewPane {

if (this.searchConfig.enableSearchEditorPreview) {
this.actions.push(
this._register(this.instantiationService.createInstance(OpenResultsInEditorAction, OpenResultsInEditorAction.ID, OpenResultsInEditorAction.LABEL))
this._register(this.instantiationService.createInstance(OpenSearchEditorAction, OpenSearchEditorAction.ID, OpenSearchEditorAction.LABEL))
);
}

Expand Down

0 comments on commit 5a1b063

Please sign in to comment.