Skip to content

Commit 93de3d6

Browse files
committed
Remove "files excluded through settings" box - microsoft#27226
1 parent b896d25 commit 93de3d6

2 files changed

Lines changed: 3 additions & 72 deletions

File tree

src/vs/workbench/parts/search/browser/searchActions.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { SearchResult, Match, FileMatch, FileMatchOrMatch } from 'vs/workbench/p
1919
import { IReplaceService } from 'vs/workbench/parts/search/common/replace';
2020
import * as Constants from 'vs/workbench/parts/search/common/constants';
2121
import { CollapseAllAction as TreeCollapseAction } from 'vs/base/parts/tree/browser/treeDefaults';
22-
import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences';
2322
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
2423
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
2524
import { ResolvedKeybinding, createKeybinding } from 'vs/base/common/keyCodes';
@@ -523,18 +522,3 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
523522
return false;
524523
}
525524
}
526-
527-
export class ConfigureGlobalExclusionsAction extends Action {
528-
529-
constructor( @IPreferencesService private preferencesService: IPreferencesService) {
530-
super('configureGlobalExclusionsAction');
531-
532-
this.label = nls.localize('ConfigureGlobalExclusionsAction.label', "Open Settings");
533-
this.enabled = true;
534-
this.class = 'search-configure-exclusions';
535-
}
536-
537-
public run(): TPromise<void> {
538-
return this.preferencesService.openGlobalSettings().then(null, errors.onUnexpectedError);
539-
}
540-
}

src/vs/workbench/parts/search/browser/searchViewlet.ts

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import { FileChangeType, FileChangesEvent, IFileService } from 'vs/platform/file
3232
import { Viewlet } from 'vs/workbench/browser/viewlet';
3333
import { Match, FileMatch, SearchModel, FileMatchOrMatch, IChangeEvent, ISearchWorkbenchService } from 'vs/workbench/parts/search/common/searchModel';
3434
import { QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder';
35-
import { MessageType, InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
36-
import { getExcludes, ISearchProgressItem, ISearchComplete, ISearchQuery, IQueryOptions, ISearchConfiguration } from 'vs/platform/search/common/search';
35+
import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
36+
import { ISearchProgressItem, ISearchComplete, ISearchQuery, IQueryOptions, ISearchConfiguration } from 'vs/platform/search/common/search';
3737
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
3838
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
3939
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -48,7 +48,7 @@ import { KeyCode } from 'vs/base/common/keyCodes';
4848
import { PatternInputWidget, ExcludePatternInputWidget } from 'vs/workbench/parts/search/browser/patternInputWidget';
4949
import { SearchRenderer, SearchDataSource, SearchSorter, SearchAccessibilityProvider, SearchFilter } from 'vs/workbench/parts/search/browser/searchResultsView';
5050
import { SearchWidget, ISearchWidgetOptions } from 'vs/workbench/parts/search/browser/searchWidget';
51-
import { RefreshAction, CollapseAllAction, ClearSearchResultsAction, ConfigureGlobalExclusionsAction } from 'vs/workbench/parts/search/browser/searchActions';
51+
import { RefreshAction, CollapseAllAction, ClearSearchResultsAction } from 'vs/workbench/parts/search/browser/searchActions';
5252
import { IReplaceService } from 'vs/workbench/parts/search/common/replace';
5353
import Severity from 'vs/base/common/severity';
5454
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
@@ -60,7 +60,6 @@ import { editorFindMatchHighlight, diffInserted, diffRemoved, diffInsertedOutlin
6060
import FileResultsNavigation from 'vs/workbench/parts/files/browser/fileResultsNavigation';
6161
import { attachListStyler } from 'vs/platform/theme/common/styler';
6262
import { IOutputService } from 'vs/workbench/parts/output/common/output';
63-
import { Color } from 'vs/base/common/color';
6463
import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search';
6564
import { PreferencesEditor } from 'vs/workbench/parts/preferences/browser/preferencesEditor';
6665

@@ -94,8 +93,6 @@ export class SearchViewlet extends Viewlet {
9493
private size: Dimension;
9594
private queryDetails: HTMLElement;
9695
private inputPatternExcludes: ExcludePatternInputWidget;
97-
private inputPatternGlobalExclusions: InputBox;
98-
private inputPatternGlobalExclusionsContainer: Builder;
9996
private inputPatternIncludes: PatternInputWidget;
10097
private results: Builder;
10198

@@ -141,7 +138,6 @@ export class SearchViewlet extends Viewlet {
141138

142139
this.toUnbind.push(this.fileService.onFileChanges(e => this.onFilesChanged(e)));
143140
this.toUnbind.push(this.untitledEditorService.onDidChangeDirty(e => this.onUntitledDidChangeDirty(e)));
144-
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated()));
145141

146142
this.selectCurrentMatchEmitter = new Emitter<string>();
147143
debounceEvent(this.selectCurrentMatchEmitter.event, (l, e) => e, 100, /*leading=*/true)
@@ -150,12 +146,6 @@ export class SearchViewlet extends Viewlet {
150146
this.delayedRefresh = new Delayer<void>(250);
151147
}
152148

153-
private onConfigurationUpdated(): void {
154-
const resource = this.contextService.hasWorkspace() ? this.contextService.getWorkspace().roots[0] : undefined;
155-
const config = this.configurationService.getConfiguration<ISearchConfiguration>(undefined, { resource });
156-
this.updateGlobalPatternExclusions(config);
157-
}
158-
159149
public create(parent: Builder): TPromise<void> {
160150
super.create(parent);
161151

@@ -236,22 +226,6 @@ export class SearchViewlet extends Viewlet {
236226
this.inputPatternExcludes.onSubmit(() => this.onQueryChanged(true, true));
237227
this.trackInputBox(this.inputPatternExcludes.inputFocusTracker);
238228
});
239-
240-
// add hint if we have global exclusion
241-
this.inputPatternGlobalExclusionsContainer = builder.div({ 'class': 'file-types global-exclude' }, (builder) => {
242-
let title = nls.localize('global.searchScope.folders', "files excluded through settings");
243-
builder.element('h4', { text: title });
244-
245-
this.inputPatternGlobalExclusions = new InputBox(builder.getContainer(), this.contextViewService, {
246-
actions: [this.instantiationService.createInstance(ConfigureGlobalExclusionsAction)],
247-
ariaLabel: nls.localize('label.global.excludes', 'Configured Search Exclude Patterns'),
248-
// override some styles because this input is disabled
249-
inputBackground: Color.transparent,
250-
inputForeground: null
251-
});
252-
this.inputPatternGlobalExclusions.inputElement.readOnly = true;
253-
$(this.inputPatternGlobalExclusions.inputElement).attr('aria-readonly', 'true');
254-
}).hide();
255229
}).getHTMLElement();
256230

257231
this.messages = builder.div({ 'class': 'messages' }).hide().clone();
@@ -271,8 +245,6 @@ export class SearchViewlet extends Viewlet {
271245
this.toggleQueryDetails(true, true, true);
272246
}
273247

274-
this.updateGlobalPatternExclusions(this.configurationService.getConfiguration<ISearchConfiguration>());
275-
276248
this.toUnbind.push(this.viewModel.searchResult.onChange((event) => this.onSearchResultsChanged(event)));
277249

278250
return TPromise.as(null);
@@ -524,30 +496,6 @@ export class SearchViewlet extends Viewlet {
524496
});
525497
}
526498

527-
private updateGlobalPatternExclusions(configuration: ISearchConfiguration): void {
528-
if (this.inputPatternGlobalExclusionsContainer) {
529-
let excludes = getExcludes(configuration);
530-
if (excludes) {
531-
let exclusions = Object.getOwnPropertyNames(excludes).filter(exclude => excludes[exclude] === true || typeof excludes[exclude].when === 'string').map(exclude => {
532-
if (excludes[exclude] === true) {
533-
return exclude;
534-
}
535-
536-
return nls.localize('globLabel', "{0} when {1}", exclude, excludes[exclude].when);
537-
});
538-
539-
if (exclusions.length) {
540-
const values = exclusions.join(', ');
541-
this.inputPatternGlobalExclusions.value = values;
542-
this.inputPatternGlobalExclusions.inputElement.title = values;
543-
this.inputPatternGlobalExclusionsContainer.show();
544-
} else {
545-
this.inputPatternGlobalExclusionsContainer.hide();
546-
}
547-
}
548-
}
549-
}
550-
551499
public selectCurrentMatch(): void {
552500
const focused = this.tree.getFocus();
553501
const eventPayload = { focusEditor: true };
@@ -750,7 +698,6 @@ export class SearchViewlet extends Viewlet {
750698

751699
this.inputPatternExcludes.setWidth(this.size.width - 28 /* container margin */);
752700
this.inputPatternIncludes.setWidth(this.size.width - 28 /* container margin */);
753-
this.inputPatternGlobalExclusions.width = this.size.width - 28 /* container margin */ - 24 /* actions */;
754701

755702
const messagesSize = this.messages.isHidden() ? 0 : dom.getTotalHeight(this.messages.getHTMLElement());
756703
const searchResultContainerSize = this.size.height -

0 commit comments

Comments
 (0)