diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts index 1ed4e3647e5..b1e0cfd210e 100644 --- a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts +++ b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts @@ -303,18 +303,11 @@ function matches(selector: CustomEditorSelector, resource: URI): boolean { return glob.match(selector.mime, mime.toLowerCase()); } - if (!selector.filenamePattern && !selector.scheme) { - return false; - } if (selector.filenamePattern) { - if (!glob.match(selector.filenamePattern.toLowerCase(), basename(resource).toLowerCase())) { - return false; + if (glob.match(selector.filenamePattern.toLowerCase(), basename(resource).toLowerCase())) { + return true; } } - if (selector.scheme) { - if (resource.scheme !== selector.scheme) { - return false; - } - } - return true; + + return false; } diff --git a/src/vs/workbench/contrib/customEditor/browser/webviewEditor.contribution.ts b/src/vs/workbench/contrib/customEditor/browser/webviewEditor.contribution.ts index 8fff4953c78..b8eaf3ae0d0 100644 --- a/src/vs/workbench/contrib/customEditor/browser/webviewEditor.contribution.ts +++ b/src/vs/workbench/contrib/customEditor/browser/webviewEditor.contribution.ts @@ -54,9 +54,9 @@ Registry.as(ConfigurationExtensions.Configuration) type: 'string', description: nls.localize('editor.editorAssociations.viewType', "Editor view type."), }, - 'scheme': { + 'mime': { type: 'string', - description: nls.localize('editor.editorAssociations.scheme', "Uri scheme the editor should be used for."), + description: nls.localize('editor.editorAssociations.mime', "Mime type the editor should be used for. This is used for binary files."), }, 'filenamePattern': { type: 'string', diff --git a/src/vs/workbench/contrib/customEditor/common/customEditor.ts b/src/vs/workbench/contrib/customEditor/common/customEditor.ts index 5a82502e225..a067470c93b 100644 --- a/src/vs/workbench/contrib/customEditor/common/customEditor.ts +++ b/src/vs/workbench/contrib/customEditor/common/customEditor.ts @@ -29,7 +29,6 @@ export const enum CustomEditorDiscretion { } export interface CustomEditorSelector { - readonly scheme?: string; readonly filenamePattern?: string; readonly mime?: string; }