From fdcd461e65aebc8432e4fbfd51b10856fcb65605 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 14 Apr 2023 11:41:20 -0500 Subject: 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. --- runtime/queries/erlang/injections.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime/queries/erlang/injections.scm') 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")) -- cgit v1.2.3-70-g09d2