Skip to content

Commit

Permalink
add markdown scope to contents of doc attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Blond11516 committed Dec 14, 2024
1 parent 208f512 commit 6459ab5
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [Unreleased]

### Added

- Identify contents of documentation attributes (`@doc`, `@moduledoc` and
`@typedoc`) as Markdown, thus enabling Markdown syntax highlighting.

## [0.0.18]

### Fixed
Expand Down
87 changes: 76 additions & 11 deletions syntaxes/elixir.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,71 +20,136 @@
"name": "meta.module.elixir"
},
{
"begin": "@(module|type)?doc (~s)?\"\"\"",
"begin": "@(?:module|type)?doc (?:~s)?\"\"\"",
"comment": "@doc with interpolated heredocs",
"end": "\\s*\"\"\"",
"name": "comment.documentation.heredoc.elixir",
"name": "documentation.heredoc.elixir",
"beginCaptures": {
"0": {
"name": "comment"
}
},
"endCaptures": {
"0": {
"name": "comment"
}
},
"patterns": [
{
"include": "#interpolated_elixir"
},
{
"include": "#escaped_char"
},
{
"include": "text.html.markdown"
}
]
},
{
"begin": "@(module|type)?doc ~s'''",
"begin": "@(?:module|type)?doc ~s'''",
"comment": "@doc with interpolated single quoted heredocs",
"end": "\\s*'''",
"name": "comment.documentation.heredoc.elixir",
"name": "documentation.heredoc.elixir",
"beginCaptures": {
"0": {
"name": "comment"
}
},
"endCaptures": {
"0": {
"name": "comment"
}
},
"patterns": [
{
"include": "#interpolated_elixir"
},
{
"include": "#escaped_char"
},
{
"include": "text.html.markdown"
}
]
},
{
"begin": "@(module|type)?doc ~S\"\"\"",
"begin": "@(?:module|type)?doc ~S\"\"\"",
"comment": "@doc with heredocs is treated as documentation",
"end": "\\s*\"\"\"",
"name": "comment.documentation.heredoc.elixir",
"name": "documentation.heredoc.elixir",
"beginCaptures": {
"0": {
"name": "comment"
}
},
"endCaptures": {
"0": {
"name": "comment"
}
},
"patterns": [
{
"include": "#escaped_char"
},
{
"include": "text.html.markdown"
}
]
},
{
"begin": "@(module|type)?doc ~S'''",
"begin": "@(?:module|type)?doc ~S'''",
"comment": "@doc with heredocs is treated as documentation",
"end": "\\s*'''",
"name": "comment.documentation.heredoc.elixir",
"name": "documentation.heredoc.elixir",
"beginCaptures": {
"0": {
"name": "comment"
}
},
"endCaptures": {
"0": {
"name": "comment"
}
},
"patterns": [
{
"include": "#escaped_char"
},
{
"include": "text.html.markdown"
}
]
},
{
"comment": "@doc false is treated as documentation",
"match": "@(module|type)?doc false",
"match": "@(?:module|type)?doc false",
"name": "comment.documentation.false"
},
{
"begin": "@(module|type)?doc \"",
"begin": "@(?:module|type)?doc \"",
"comment": "@doc with string is treated as documentation",
"end": "\"",
"name": "comment.documentation.string",
"name": "documentation.string",
"beginCaptures": {
"0": {
"name": "comment"
}
},
"endCaptures": {
"0": {
"name": "comment"
}
},
"patterns": [
{
"include": "#interpolated_elixir"
},
{
"include": "#escaped_char"
},
{
"include": "text.html.markdown"
}
]
},
Expand Down

0 comments on commit 6459ab5

Please sign in to comment.