This commit is contained in:
Logan Ramos 2021-07-07 13:54:22 -04:00
parent 52b9b964c1
commit a541cbf2e7
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183
2 changed files with 5 additions and 2 deletions

View file

@ -271,7 +271,7 @@ export class EditorResolverService extends Disposable implements IEditorResolver
for (const [key, editors] of this._editors) {
for (const editor of editors) {
const foundInSettings = userSettings.find(setting => setting.viewType === editor.editorInfo.id);
if (foundInSettings || globMatchesResource(key, resource)) {
if ((foundInSettings && editor.editorInfo.priority !== RegisteredEditorPriority.exclusive) || globMatchesResource(key, resource)) {
matchingEditors.push(editor);
}
}
@ -288,6 +288,9 @@ export class EditorResolverService extends Disposable implements IEditorResolver
public getEditorIds(resource: URI): string[] {
const editors = this.findMatchingEditors(resource);
if (editors.find(e => e.editorInfo.priority === RegisteredEditorPriority.exclusive)) {
return [];
}
return editors.map(editor => editor.editorInfo.id);
}

View file

@ -149,7 +149,7 @@ export interface IEditorResolverService {
resolveEditor(editor: IEditorInputWithOptions | IUntypedEditorInput, preferredGroup: PreferredGroup | undefined): Promise<ResolvedEditor>;
/**
* Given a resource returns all the editor ids that match that resource
* Given a resource returns all the editor ids that match that resource. If there is exclusive editor we return an empty array
* @param resource The resource
* @returns A list of editor ids
*/