-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add embedded language support for markdown in @docs and @moduledocs #87
Comments
@Terbium-135 This should be fixed on main. Please pull the latest main and try it out when you get the chance. Thanks! |
@Blond11516 I tried that in ElixirLS v0.15 and had to revert as markdown rules would leak out of context and break highlighting of everything following. See elixir-lsp/vscode-elixir-ls#315 (comment) |
So from what I've seen the issue of leakage is caused by the additional indentation that For example, as soon as the heredoc contains a list, vscode interprets everything coming after it as a list element, because the markdown is indented as such: This then appears to cause the next closing heredoc to be missed for whatever reason. A custom markdown grammar might indeed be able to fix this, but that's obviously not a very desirable solution. I'll dig a bit into TextMate to see if there's any way to have it ignore this identation but I wouldn't bet on that being the case. Ideally I'd like to see how other extensions handle this; it would need to be a grammar that injects a whitespace-sensitive language (markdown, python, etc.) with some implicit indentation but I don't have any ideas off the top of my head. I'm all ears if anyone knows of something like this 🤷 I've pushed a small reproduction repository with examples of list and nested module failures. |
I've reverted the changes from main and pushed them back in a new branch. |
Thank you for all your work and investigation so far! |
I think a while pattern should do the trick, see elixir-lsp/vscode-elixir-ls#315 (comment). Confirmed working (with ElixirLS) for the examples from https://github.com/Blond11516/markdown-leakage-repro |
Right now I am extracting the text into a markdown file, edit and copy back.
It would be very nice to get syntax highlighting for @doc and @moduledoc parts. Since these are markdown the readability might increase.
Instead of this:
one might see:
The text was updated successfully, but these errors were encountered: