diff options
author | Michael Davis | 2023-04-14 16:41:20 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2024-03-21 15:20:29 +0000 |
commit | fdcd461e65aebc8432e4fbfd51b10856fcb65605 (patch) | |
tree | 5efb57366aa5015c1cf9073beca2f9ea3f258fda /runtime/queries/erlang/injections.scm | |
parent | 459eb9a4c12a4c650c551a4fe2746b3187fefadd (diff) |
Update tree-sitter-erlang and highlights
A few changes:
* 0-arity type specs like the following previously would not have the
expected 'variable.parameter' highlighting for the return type:
-spec foo() -> Value when Value :: term().
* Highlight module, type and function docs as documentation comments
and inject markdown into them.
* Replace `#match?` predicates with `#any-of?` where possible.
* Remove custom auto-pairs. Now that Erlang uses markdown for
documentation, the asciidoc-style backtick-singlequote pair is no
longer useful.
Diffstat (limited to 'runtime/queries/erlang/injections.scm')
-rw-r--r-- | runtime/queries/erlang/injections.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/queries/erlang/injections.scm b/runtime/queries/erlang/injections.scm index 11cbd01e..798882f5 100644 --- a/runtime/queries/erlang/injections.scm +++ b/runtime/queries/erlang/injections.scm @@ -5,3 +5,13 @@ ((comment (comment_content) @injection.content) (#set! injection.language "comment")) + +; EEP-59 doc attributes use markdown by default. +(attribute + name: (atom) @_attribute + (arguments [ + (string (quoted_content) @injection.content) + (sigil (quoted_content) @injection.content) + ]) + (#set! injection.language "markdown") + (#any-of? @_attribute "doc" "moduledoc")) |