Commit 833d235
Support for embedded Markdown comments
Summary:
Erlang/OTP 27 introduces Markdown comments. While this makes it in theory simpler to author in-code documentation, the VS Code extension does not yet recognize comments as Markdown.
This change makes VS Code recognize doc blocks as Markdown, using the concept of an [embedded language](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#embedded-languages).
This provides features such as:
* Syntax highlighting for italic, bold, code blocks, etc
* Matching parentheses
* Ability to embed Erlang code blocks with syntax highlighting
* Etc
While this simply works(TM), it makes the doc block too evident and distracting:
{F1978476087}
To preserve the look-and-feel of the old edoc-style comment, we override the default colour for the embedded markdown block. This seems to work fine in both light and dark mode and can always be overridden by a user using the `settings.json` file:
```
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.embedded.block.markdown",
"settings": {
"foreground": "MY_FAVOURITE_COLOUR"
}
}
],
}
```
The change is being upstreamed [here](erlang-ls/grammar#18).
Reviewed By: alanz
Differential Revision: D75152988
fbshipit-source-id: 3922007c13678be99fb27c99e53f8597c7dcba8f1 parent 846bba1 commit 833d235
2 files changed
+16
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
| 607 | + | |
| 608 | + | |
607 | 609 | | |
608 | 610 | | |
609 | 611 | | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 612 | + | |
| 613 | + | |
616 | 614 | | |
617 | 615 | | |
618 | 616 | | |
| |||
0 commit comments