mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode 31e03b8ffbb218a87e3941f2b63a249f061fe0e4 (#4986)
This commit is contained in:
@@ -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 } from 'vs/workbench/contrib/search/browser/searchActions';
|
||||
import { CancelSearchAction, ClearSearchResultsAction, CollapseDeepestExpandedLevelAction, RefreshAction, IFindInFilesArgs } 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';
|
||||
@@ -452,8 +452,12 @@ export class SearchView extends ViewletPanel {
|
||||
return;
|
||||
}
|
||||
|
||||
const root = element instanceof SearchResult ? null : element;
|
||||
this.tree.setChildren(root, this.createIterator(element, collapseResults));
|
||||
if (element instanceof SearchResult) {
|
||||
this.tree.setChildren(null, this.createIterator(element, collapseResults));
|
||||
} else {
|
||||
this.tree.setChildren(element, this.createIterator(element, collapseResults));
|
||||
this.tree.rerender(element);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -642,7 +646,7 @@ export class SearchView extends ViewletPanel {
|
||||
}));
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
|
||||
const resourceNavigator = this._register(new TreeResourceNavigator2(this.tree, { openOnFocus: true }));
|
||||
const resourceNavigator = this._register(new TreeResourceNavigator2(this.tree, { openOnFocus: true, openOnSelection: false }));
|
||||
this._register(Event.debounce(resourceNavigator.onDidOpenResource, (last, event) => event, 75, true)(options => {
|
||||
if (options.element instanceof Match) {
|
||||
const selectedMatch: Match = options.element;
|
||||
@@ -1043,6 +1047,37 @@ export class SearchView extends ViewletPanel {
|
||||
this.onQueryChanged(true);
|
||||
}
|
||||
|
||||
setSearchParameters(args: IFindInFilesArgs = {}): void {
|
||||
if (typeof args.isCaseSensitive === 'boolean') {
|
||||
this.searchWidget.searchInput.setCaseSensitive(args.isCaseSensitive);
|
||||
}
|
||||
if (typeof args.matchWholeWord === 'boolean') {
|
||||
this.searchWidget.searchInput.setWholeWords(args.matchWholeWord);
|
||||
}
|
||||
if (typeof args.isRegex === 'boolean') {
|
||||
this.searchWidget.searchInput.setRegex(args.isRegex);
|
||||
}
|
||||
if (typeof args.filesToInclude === 'string') {
|
||||
this.searchIncludePattern.setValue(String(args.filesToInclude));
|
||||
}
|
||||
if (typeof args.filesToExclude === 'string') {
|
||||
this.searchExcludePattern.setValue(String(args.filesToExclude));
|
||||
}
|
||||
if (typeof args.query === 'string') {
|
||||
this.searchWidget.searchInput.setValue(args.query);
|
||||
}
|
||||
if (typeof args.replace === 'string') {
|
||||
this.searchWidget.replaceInput.value = args.replace;
|
||||
} else {
|
||||
if (this.searchWidget.replaceInput.value !== '') {
|
||||
this.searchWidget.replaceInput.value = '';
|
||||
}
|
||||
}
|
||||
if (typeof args.triggerSearch === 'boolean' && args.triggerSearch) {
|
||||
this.onQueryChanged(true);
|
||||
}
|
||||
}
|
||||
|
||||
toggleQueryDetails(moveFocus = true, show?: boolean, skipLayout?: boolean, reverse?: boolean): void {
|
||||
const cls = 'more';
|
||||
show = typeof show === 'undefined' ? !dom.hasClass(this.queryDetails, cls) : Boolean(show);
|
||||
|
||||
Reference in New Issue
Block a user