提交 b0a34cea 编写于 作者: R Rob Lourens

Fix #56487 - Don't search in models that aren't open

上级 03f2f7e0
......@@ -27,6 +27,7 @@ import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/un
import { IRawSearch, IRawSearchService, ISerializedFileMatch, ISerializedSearchComplete, ISerializedSearchProgressItem, isSerializedSearchComplete, isSerializedSearchSuccess, ITelemetryEvent } from './search';
import { ISearchChannel, SearchChannelClient } from './searchIpc';
import { getPathFromAmdModule } from 'vs/base/common/amd';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
export class SearchService extends Disposable implements ISearchService {
public _serviceBrand: any;
......@@ -39,6 +40,7 @@ export class SearchService extends Disposable implements ISearchService {
constructor(
@IModelService private modelService: IModelService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
@IEditorService private editorService: IEditorService,
@IEnvironmentService environmentService: IEnvironmentService,
@ITelemetryService private telemetryService: ITelemetryService,
@IConfigurationService private configurationService: IConfigurationService,
......@@ -235,6 +237,10 @@ export class SearchService extends Disposable implements ISearchService {
return;
}
if (!this.editorService.isOpen({ resource })) {
return;
}
// Support untitled files
if (resource.scheme === Schemas.untitled) {
if (!this.untitledEditorService.exists(resource)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册