diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts index b8bd2479149624aeb2b832cbe2d8608134857369..4a102364c288cacf801a3a712494e5aa96167a6b 100644 --- a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts +++ b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts @@ -325,10 +325,15 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ this._webviewHasOwnEditFunctions.set(possibleEditors.length > 0); } - private async handleMovedFileInOpenedFileEditors(_oldResource: URI, newResource: URI): Promise { + private async handleMovedFileInOpenedFileEditors(oldResource: URI, newResource: URI): Promise { + if (extname(oldResource) === extname(newResource)) { + return; + } + // See if the new resource can be opened in a custom editor - const possibleEditors = this.getAllCustomEditors(newResource).allEditors; - if (!possibleEditors.length) { + if (!this.getAllCustomEditors(newResource).allEditors + .some(editor => editor.priority !== CustomEditorPriority.option) + ) { return; }