Get rid of canHandleDiff
This commit is contained in:
parent
392b74e008
commit
6056645892
6 changed files with 3 additions and 12 deletions
|
@ -85,7 +85,6 @@ class SearchEditorContribution implements IWorkbenchContribution {
|
|||
},
|
||||
{
|
||||
singlePerResource: true,
|
||||
canHandleDiff: false,
|
||||
canSupportResource: resource => (extname(resource) === SEARCH_EDITOR_EXT)
|
||||
},
|
||||
({ resource }) => {
|
||||
|
|
|
@ -169,7 +169,6 @@ export class TerminalService implements ITerminalService {
|
|||
priority: RegisteredEditorPriority.exclusive
|
||||
},
|
||||
{
|
||||
canHandleDiff: false,
|
||||
canSupportResource: uri => uri.scheme === Schemas.vscodeTerminal,
|
||||
singlePerResource: true
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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) }),
|
||||
);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue