Skip to content

Custom editors: Allow setting different priorities for edit/diff/merge #292379

Closed

Description

@jmcclure-Google

This is a rephrasing of #138525.

We are working on a custom-editor extension for .custom.md files that allows interacting with markdown outside the IDE's normal text editor, including buttons, checkboxes, and paragraphs that morph into textareas when you click them.

The .custom.md format is normal markdown format, but our vscode extension overlays it with a webview so you can interact with checkboxes, plus buttons, and accept buttons to modify the underlying file.

One point of frustration with our custom editor is merging/diffing. While we absolutely want this editor to be the default editor for .custom.md files, it does not currently support merging/diffing very well.

So, for merging/diffing, we would strongly prefer to use the text editor by default. However, there does not appear to be such an option. Defaults are controlled by contributes.customEditors.priority in package.json. For example:

  "contributes": {
    "customEditors": [
      {
        "viewType": "custom-markdown.editor",
        "displayName": "Custom Markdown Editor",
        "selector": [
          {
            "filenamePattern": "*.custom.md"
          }
        ],
        "priority": "default"
      }
    ]
  }

priority: default causes edit, diff, and merge to use the custom editor by default. priority: option causes them to use the text editor by default. We feel it would be too inconvenient/unexpected to make users select the custom editor each time they want to edit a .custom.md file.

I tried a fair amount of workarounds, like:

    "configurationDefaults": {
      "workbench.editorAssociations": { "*.custom.md": "custom-markdown.editor" }
    },
    "customEditors": [
      {
        "viewType": "custom-markdown.editor",
        "displayName": "Custom Markdown Editor",
        "selector": [
          {
            "filenamePattern": "*.custom.md"
          }
        ],
        "priority": "option"
      }
    ],

But nothing resolved the issue. A proposed alternative would be to replace the priority option with:

"editPriority": "default",
"diffPriority": "option",
"mergePriority": "option"

Would it be possible to add this feature? Thanks!

Activity

  1. added
    feature-request
    custom-editors
    on May 8, 2026
  2. added this to the 1.120.0 milestone on May 8, 2026
  3. added
    unreleased
    on May 8, 2026
  4. added a commit that references this issue on May 8, 2026
    1a8d9d0
  5. mjbvz commented on May 8, 2026

    @mjbvz
    Contributor

    Added this in #315321 but reopening as right now this is still an API proposal. The current names are diffEditorPriority and mergeEditorPriority

    Please give it a try and let me know if you run into an issues!

  6. removed
    unreleased
    on May 8, 2026
  7. 32 remaining items

  8. hediet commented on Jul 27, 2026

    @hediet
    Member

    Actually, let's keep this issue open to track the finalization of per-editor-type priorities.

    Currently proposed customEditors.priority feature

    Allow extensions to declare custom-editor priority per editor mode:

    "priority": {
      "textEditor": "option",
      "diffEditor": "explicit"
    }

    Values:

    • default — automatically use the custom editor in this mode.
    • option — offer it as an alternative. If the user sets it as default in one option mode, all other option modes are opted in too.
    • explicit — do not include it in cross-mode opt-in; require an explicit association for this mode.

    This lets extensions distinguish well-supported modes from degraded ones while preserving user choice. Existing scalar values remain compatible, with diff mode treated as explicit by default.

  9. added
    unreleased
    on Aug 4, 2026
  10. added
    insiders-released
    verification-needed
    and removed
    unreleased
    on Aug 5, 2026
  11. Munir786-dot commented on Aug 21, 2026

    @Munir786-dot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apiapi-finalizationcustom-editorsfeature-requestinsiders-releasedverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions