Skip to content

Commit 0ed7ab8

Browse files
committed
Merge branch 'master' into sandy081/statusOcticons
2 parents b85f6d7 + 4afdee0 commit 0ed7ab8

6 files changed

Lines changed: 28 additions & 16 deletions

File tree

src/vs/editor/contrib/gotoError/gotoErrorWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { IMarker, MarkerSeverity, IRelatedInformation } from 'vs/platform/marker
1111
import { Position } from 'vs/editor/common/core/position';
1212
import { Range } from 'vs/editor/common/core/range';
1313
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
14-
import { registerColor, oneOf, textLinkForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, editorErrorBorder, editorWarningBorder, editorInfoBorder } from 'vs/platform/theme/common/colorRegistry';
14+
import { registerColor, oneOf, textLinkForeground, editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder } from 'vs/platform/theme/common/colorRegistry';
1515
import { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
1616
import { Color } from 'vs/base/common/color';
1717
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
Lines changed: 6 additions & 1 deletion
Loading
Lines changed: 8 additions & 1 deletion
Loading

src/vs/workbench/contrib/search/browser/openFileHandler.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ export class OpenFileHandler extends QuickOpenHandler {
117117
private cacheState: CacheState;
118118

119119
constructor(
120-
@IEditorService private readonly editorService: IEditorService,
121120
@IInstantiationService private readonly instantiationService: IInstantiationService,
122121
@IWorkbenchThemeService private readonly themeService: IWorkbenchThemeService,
123122
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@@ -208,7 +207,7 @@ export class OpenFileHandler extends QuickOpenHandler {
208207
private doResolveQueryOptions(query: IPreparedQuery, cacheKey?: string, maxSortedResults?: number): IFileQueryBuilderOptions {
209208
const queryOptions: IFileQueryBuilderOptions = {
210209
_reason: 'openFileHandler',
211-
extraFileResources: getOutOfWorkspaceEditorResources(this.editorService, this.contextService),
210+
extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources),
212211
filePattern: query.original,
213212
cacheKey
214213
};
@@ -233,7 +232,7 @@ export class OpenFileHandler extends QuickOpenHandler {
233232
private cacheQuery(cacheKey: string): IFileQuery {
234233
const options: IFileQueryBuilderOptions = {
235234
_reason: 'openFileHandler',
236-
extraFileResources: getOutOfWorkspaceEditorResources(this.editorService, this.contextService),
235+
extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources),
237236
filePattern: '',
238237
cacheKey: cacheKey,
239238
maxResults: 0,

src/vs/workbench/contrib/search/browser/searchView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ export class SearchView extends ViewletPanel {
11941194

11951195
const options: ITextQueryBuilderOptions = {
11961196
_reason: 'searchView',
1197-
extraFileResources: getOutOfWorkspaceEditorResources(this.editorService, this.contextService),
1197+
extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources),
11981198
maxResults: SearchView.MAX_TEXT_RESULTS,
11991199
disregardIgnoreFiles: !useExcludesAndIgnoreFiles || undefined,
12001200
disregardExcludeSettings: !useExcludesAndIgnoreFiles || undefined,

src/vs/workbench/contrib/search/common/search.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { URI } from 'vs/base/common/uri';
1212
import { toResource, SideBySideEditor } from 'vs/workbench/common/editor';
1313
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
1414
import { CancellationToken } from 'vs/base/common/cancellation';
15+
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
16+
import { IFileService } from 'vs/platform/files/common/files';
1517

1618
export interface IWorkspaceSymbol {
1719
name: string;
@@ -81,15 +83,14 @@ export interface IWorkbenchSearchConfiguration extends ISearchConfiguration {
8183
/**
8284
* Helper to return all opened editors with resources not belonging to the currently opened workspace.
8385
*/
84-
export function getOutOfWorkspaceEditorResources(editorService: IEditorService, contextService: IWorkspaceContextService): URI[] {
85-
const resources: URI[] = [];
86+
export function getOutOfWorkspaceEditorResources(accessor: ServicesAccessor): URI[] {
87+
const editorService = accessor.get(IEditorService);
88+
const contextService = accessor.get(IWorkspaceContextService);
89+
const fileService = accessor.get(IFileService);
8690

87-
editorService.editors.forEach(editor => {
88-
const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
89-
if (resource && !contextService.isInsideWorkspace(resource)) {
90-
resources.push(resource);
91-
}
92-
});
91+
const resources = editorService.editors
92+
.map(editor => toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }))
93+
.filter(resource => !!resource && !contextService.isInsideWorkspace(resource) && fileService.canHandleResource(resource));
9394

94-
return resources;
95+
return resources as URI[];
9596
}

0 commit comments

Comments
 (0)