Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languages/erlang/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Erlang"
grammar = "erlang"
# TODO: support parsing rebar.config files
# # https://github.com/WhatsApp/tree-sitter-erlang/issues/3
path_suffixes = ["erl", "hrl", "app.src", "escript", "xrl", "yrl", "Emakefile", "rebar.config"]
path_suffixes = ["erl", "erlang", "hrl", "app.src", "escript", "xrl", "yrl", "Emakefile", "rebar.config"]
line_comments = ["% ", "%% ", "%%% "]
autoclose_before = ";:.,=}])>"
brackets = [
Expand Down
17 changes: 17 additions & 0 deletions languages/erlang/injections.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
((comment) @injection.content
(#set! injection.language "comment"))

; EEP-59 doc attributes use Markdown by default.
(wild_attribute
name: (attr_name
name: (atom) @_attribute)
value: (string) @injection.content
(#any-of? @_attribute "doc" "moduledoc")
(#set! injection.language "markdown"))

; Also support the accepted parenthesized attribute form.
(wild_attribute
name: (attr_name
name: (atom) @_attribute)
value: (paren_expr
expr: (string) @injection.content)
(#any-of? @_attribute "doc" "moduledoc")
(#set! injection.language "markdown"))
Loading