Autocompletion for code block types

Use case or problem

Many plugins implement code block handlers to inject specially formatted blocks into markdown documents (eg. Mermaid, ABC). If I rarely type out these code blocks, it’s easy to forget the proper keywords to activate them (e.g. mermaid or music-abc).

Proposed solution

When I open a code block using ``` (3 backticks), Obsidian could offer autocompletion for known keywords:

  • those registered by plugins using registerMarkdownCodeBlockProcessor(); and
  • those understood by the built-in PrismJS parser.

Ideally, the autocomplete list would visualize the distinction between plugins and languages. Maybe even allow filtering plugins/languages only.

Current workaround (optional)

Find another note where I used that particular code block, view the source.

Related feature requests (optional)

1 Like

There is already this plugin for custom codeblocks:

Its not in the Community plugins, maybe bug the author about that and put in a Feature Request for the languages supported by Prism.

2 Likes

Thanks @joethei ! I had no idea this was possible to do from a plugin.