提交 f4151841 编写于 作者: M Matt Bierner

Don't prompt on renaming markdown files

Add two extra checks:
- Don't prompt users if the file extension doesn't change
- Don't prompt if only optional editors are available
上级 30f6143a
......@@ -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<void> {
private async handleMovedFileInOpenedFileEditors(oldResource: URI, newResource: URI): Promise<void> {
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册