Get rid of canHandleDiff

This commit is contained in:
Logan Ramos 2021-06-28 10:06:24 -04:00
parent 392b74e008
commit 6056645892
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183
6 changed files with 3 additions and 12 deletions

View file

@ -85,7 +85,6 @@ class SearchEditorContribution implements IWorkbenchContribution {
},
{
singlePerResource: true,
canHandleDiff: false,
canSupportResource: resource => (extname(resource) === SEARCH_EDITOR_EXT)
},
({ resource }) => {

View file

@ -169,7 +169,6 @@ export class TerminalService implements ITerminalService {
priority: RegisteredEditorPriority.exclusive
},
{
canHandleDiff: false,
canSupportResource: uri => uri.scheme === Schemas.vscodeTerminal,
singlePerResource: true
},

View file

@ -130,8 +130,7 @@ export class EditorOverrideService extends Disposable implements IEditorOverride
return OverrideStatus.NONE;
}
const handlesDiff = typeof selectedEditor.options?.canHandleDiff === 'function' ? selectedEditor.options.canHandleDiff() : selectedEditor.options?.canHandleDiff;
if (handlesDiff === false && isResourceDiffEditorInput(editor)) {
if (selectedEditor.createDiffEditorInput === undefined && isResourceDiffEditorInput(editor)) {
return OverrideStatus.NONE;
}

View file

@ -82,10 +82,6 @@ export type RegisteredEditorOptions = {
* If your editor cannot be opened in multiple groups for the same resource
*/
singlePerResource?: boolean | (() => boolean);
/**
* If your editor supports diffs
*/
canHandleDiff?: boolean | (() => boolean);
/**
* Whether or not you can support opening the given resource.

View file

@ -38,9 +38,7 @@ suite('EditorOverrideService', () => {
detail: 'Test Editor Details',
priority: RegisteredEditorPriority.default
},
{
canHandleDiff: false
},
{},
resource => ({ editor: new TestFileEditorInput(URI.parse(resource.toString()), TEST_EDITOR_INPUT_ID) }),
);

View file

@ -204,7 +204,7 @@ suite('EditorService', () => {
disposables.add(accessor.editorOverrideService.registerEditor(
'*.editor-service-override-tests',
{ id: 'editorServiceOverrideTests', label: 'Label', priority: RegisteredEditorPriority.exclusive },
{ canHandleDiff: true },
{},
editor => {
editorFactoryCalled++;
lastEditorFactoryEditor = editor;