You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Daniel Imms, KillyMXI, AnturK, Sebastian Mezger, Thomas-Grimmeisen, Segev Finer, yy0931, Bernhard Weller, Ulaş Özgüler, Ralph Soika and 28 more
It would be nice if the user could have control over this using the View: Reopen Editor With... or View: Reopen Editor With Text Editor commands (which is the case for the "compare files" feature). Even nicer might be if such a control (dropdown?) were available in the action bar (at the top right of the workbench).
PS: Currently it seems some bug with configurationDefaults in VS Code 1.85.0, and it's fixed #194087 . configurationDefaults with workbench.editorAssociations should work fine use in VS Code 1.86.0, and now we can already use workbench.editorAssociations to test various scenes.
Weijan Chen (@cweijan) thanks for your feedback. But I think this is not the solution for the problem. The configuration you mentioned is the general mapping for a file extension and your custom editor. We also use this in our Open-BPMN project to link .bpmn and .bpmn2 files with the editor.
But the question is: How can I overwrite this editor linking for the Diff-Compare View? This is another editor type in vs-code that overtakes the default mappings.
I am searching for a way to re-configure the Diff Editor in some way to show changes in bpmn file not graphical but in a text editor.
Weijan Chen (@cweijan) Thank you this is works like a charm for me! Ralph Soika (@rsoika) note the file:/ in the beginning of the filenamePattern - this is not present in the project you linked and was missing for me aswell.
Hi, thanks for your answer. It seems that I am not able to follow your suggestions here. My example was a deep configuration detail in my extension code itself. This is to associate my own extension (providing a custom editor) with a specific file extension. And this all works fine. So I can open a .bpmn file with the extension editor or a default text editor.
But with this configuration in case of a GIT staging situation the Diff Editor View open two graphical editors. And this is what I want to avoid:
Jufeng Zhang (@zjffun) mentioned something like the following using the priority option:
But what I did not understand here is the view type custom-diff-editor ? Is this a vs-code editor feature that I just need to configure with the priority 'option' ? Or was this a suggestion for a possible solution in the future?
diffEditorAssociations can be used to opt out of using the custom editor as side-by-side diff view:
// *.md opens in the custom markdown editor normally"workbench.editorAssociations": {"*.md": "vscode.markdown.editor"},// diffs of *.md use the default text diff editor instead - without this, the markdown editor would be shown side-by-side for diffs."workbench.diffEditorAssociations": {"*.md": "default"}
However, I think it would be better to have an opt-in instead of opt-out mechanism here, e.g.:
"workbench.editorAssociations": {"*.md": {editor: "vscode.markdown.editor"}// only handle the editor view, not diff editor},
...otherwise every extension that provides a custom editor would need to reset the diff editor association.
Activity
Tyriar commentedon Feb 18, 2022
👍 hex editor and luna paint could also provide nicer diff experiences.
fchen7i commentedon Jan 30, 2023
#171381 is slightly different. we want to use a new webview to do the compare
starball5 commentedon Jul 3, 2023
It would be nice if the user could have control over this using the
View: Reopen Editor With...orView: Reopen Editor With Text Editorcommands (which is the case for the "compare files" feature). Even nicer might be if such a control (dropdown?) were available in the action bar (at the top right of the workbench).Related on Stack Overflow:
zjffun commentedon Dec 8, 2023
Set default editor for diff view
We can use
workbench.editorAssociationsandconfigurationDefaultsto set default editor for diff view, like:Text editor diff view:
{ "configurationDefaults": { "workbench.editorAssociations": { "{git,gitlens}:/**/*.{drawio,dio,dio.svg,drawio.svg}": "default", } } }Image preview diff view:
{ "configurationDefaults": { "workbench.editorAssociations": { "{git,gitlens}:/**/*.{bmp,dib,ico,png,jif,jpe,jpg,jpeg,tga,tpic,webp}": "imagePreview.previewEditor", } } }Set different custom editor for diff view and edit view
{ "configurationDefaults": { "workbench.editorAssociations": { "{git,gitlens}:/**/*.custom-ext": "custom-diff-editor", } }, "customEditors": [ { "viewType": "custom-editor", "displayName": "custom-editor", "selector": [ { "filenamePattern": "*.custom-ext" } ], "priority": "default" }, { "viewType": "custom-diff-editor", "displayName": "custom-diff-editor", "selector": [ { "filenamePattern": "*.custom-ext" } ], "priority": "option" } ] }Example
Edit view:

Diff view:

PS: Currently it seems some bug with
configurationDefaultsinVS Code 1.85.0, and it's fixed #194087 .configurationDefaultswithworkbench.editorAssociationsshould work fine use inVS Code 1.86.0, and now we can already useworkbench.editorAssociationsto test various scenes.Using default editor in diff mode
[vscode][ez] Use Default Diff View for .aiconfig.json/yaml Diff View (#…
cweijan commentedon Mar 5, 2024
I found the final solution, which is surprisingly simple, and I think this issue can be closed.
{ "viewType": "viewType", "displayName": "Custom Editor", "selector": [ { "filenamePattern": "file:/**/*.ext" } ] }hanjoosten commentedon Mar 5, 2024
Weijan Chen (@cweijan) , Could you elaborate? Where should this json be configured?
rsoika commentedon Mar 5, 2024
Weijan Chen (@cweijan) thanks for your feedback. But I think this is not the solution for the problem. The configuration you mentioned is the general mapping for a file extension and your custom editor. We also use this in our Open-BPMN project to link
.bpmnand.bpmn2files with the editor.But the question is: How can I overwrite this editor linking for the Diff-Compare View? This is another editor type in vs-code that overtakes the default mappings.
I am searching for a way to re-configure the Diff Editor in some way to show changes in bpmn file not graphical but in a text editor.
Thomas-Grimmeisen commentedon Mar 5, 2024
Weijan Chen (@cweijan) Thank you this is works like a charm for me!
Ralph Soika (@rsoika) note the file:/ in the beginning of the filenamePattern - this is not present in the project you linked and was missing for me aswell.
rsoika commentedon Mar 5, 2024
Hi, thanks for your answer. It seems that I am not able to follow your suggestions here. My example was a deep configuration detail in my extension code itself. This is to associate my own extension (providing a custom editor) with a specific file extension. And this all works fine. So I can open a
.bpmnfile with the extension editor or a default text editor.But with this configuration in case of a GIT staging situation the Diff Editor View open two graphical editors. And this is what I want to avoid:
Jufeng Zhang (@zjffun) mentioned something like the following using the priority option:
But what I did not understand here is the view type
custom-diff-editor? Is this a vs-code editor feature that I just need to configure with the priority 'option' ? Or was this a suggestion for a possible solution in the future?20 remaining items
ulugbekna commentedon Jun 10, 2026
Moved out to On Deck as a left-over on 1.124 milestone
Small tweaks to custom editor diff api
hediet commentedon Jun 29, 2026
diffEditorAssociationscan be used to opt out of using the custom editor as side-by-side diff view:However, I think it would be better to have an opt-in instead of opt-out mechanism here, e.g.:
...otherwise every extension that provides a custom editor would need to reset the diff editor association.
hediet commentedon Jul 7, 2026
Covered by #324791.