Skip to content

Commit cd90f80

Browse files
committed
Remove customEditor.scheme contribution point
1 parent f727446 commit cd90f80

3 files changed

Lines changed: 6 additions & 14 deletions

File tree

src/vs/workbench/contrib/customEditor/browser/customEditors.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,11 @@ function matches(selector: CustomEditorSelector, resource: URI): boolean {
303303
return glob.match(selector.mime, mime.toLowerCase());
304304
}
305305

306-
if (!selector.filenamePattern && !selector.scheme) {
307-
return false;
308-
}
309306
if (selector.filenamePattern) {
310-
if (!glob.match(selector.filenamePattern.toLowerCase(), basename(resource).toLowerCase())) {
311-
return false;
312-
}
313-
}
314-
if (selector.scheme) {
315-
if (resource.scheme !== selector.scheme) {
316-
return false;
307+
if (glob.match(selector.filenamePattern.toLowerCase(), basename(resource).toLowerCase())) {
308+
return true;
317309
}
318310
}
319-
return true;
311+
312+
return false;
320313
}

src/vs/workbench/contrib/customEditor/browser/webviewEditor.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
5454
type: 'string',
5555
description: nls.localize('editor.editorAssociations.viewType', "Editor view type."),
5656
},
57-
'scheme': {
57+
'mime': {
5858
type: 'string',
59-
description: nls.localize('editor.editorAssociations.scheme', "Uri scheme the editor should be used for."),
59+
description: nls.localize('editor.editorAssociations.mime', "Mime type the editor should be used for. This is used for binary files."),
6060
},
6161
'filenamePattern': {
6262
type: 'string',

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const enum CustomEditorDiscretion {
2929
}
3030

3131
export interface CustomEditorSelector {
32-
readonly scheme?: string;
3332
readonly filenamePattern?: string;
3433
readonly mime?: string;
3534
}

0 commit comments

Comments
 (0)