API Request: Expose Codemirror loaded Language instances

I made a request issue on the Obsidian API github here but I thought this might be relevant to other developers so should be on the forum as well


It would be useful to expose the loaded Language instances (or LanguageSupport) instances that obsidian has loaded so that plugins could add codemirror syntax highlighting in editing mode.


This would expose further functionality to allow for plugins to have a more in-depth ability to deal with writing code (i.e. adding autocompletion, bracket matching or other language features).
Also it would mean that a plugin reliant on the ‘@codemirror/lang-data’ module wouldn’t have to load a new instance of a language (that obsidian has already loaded) to use syntax highlighting.

Thank you for your consideration!

If you would also like this added to the API, please react to this thread and/or the github issue :).

1 Like

I also added this additional request:

In addition, it would be great to expose the Highlighter that Obsidian uses (even if the languages themselves are not exposed) so plugins would have highlighting style classes consistent with obsidian itself.