Remove customEditor.scheme contribution point

This commit is contained in:
Matt Bierner
2019-09-25 19:04:31 -07:00
parent f7274467ca
commit cd90f80b3e
3 changed files with 6 additions and 14 deletions

View File

@@ -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;
}

View File

@@ -54,9 +54,9 @@ Registry.as<IConfigurationRegistry>(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',

View File

@@ -29,7 +29,6 @@ export const enum CustomEditorDiscretion {
}
export interface CustomEditorSelector {
readonly scheme?: string;
readonly filenamePattern?: string;
readonly mime?: string;
}