VSCode: Embedded language (markdown) for @doc, @moduledoc, @typedoc - thoughts on getting syntax highlighting?

We were talking about this over at discord, perhaps somebody in this forum has more insight or already did that. Just trying to enlarge the audience here.

Given the fact that @doc, @moduledoc, @typedoc comments can contain MD it would be nice to get at least syntax highlighting (if not even more functionality) in VSCode.

Not sure about how other editors are handling this.

To do the editing right now:

  • I am copy/pasting these (well only the bigger ones) into a separate file with the proper .md ending
  • Open that file, edit and do a markdown preview sometimes
  • Copy back into elixir source file

@Blond11516 and @lukaszsamson discovered that VSCode is leaking markdown into elixir code.

But it would be so nice to look at the latter while writing/extending documentation (Note: you can see markdown leaking here into elixir:

With best regards

Heyo, not an expert on TextMate grammars, but I recently did some research on while patterns, which should help. I commented in the linked issue. Maybe that helps!

3 Likes

Thank you @steffend !
This is looking great so far:

Now writing documentation is even more fun! :stuck_out_tongue_winking_eye:

1 Like