Skip to content

Commit

Permalink
update tree-sitter-erlang
Browse files Browse the repository at this point in the history
changes:

- typed fields within records which do not declare a default
  value are now correctly highlighted as record fields
- the EEP49 'maybe' form is now parsed
- fixes for highlights for 'begin' and 'after' tokens
  • Loading branch information
the-mikedavis authored and archseer committed Mar 30, 2022
1 parent f2dd3d4 commit e2a5071
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| dockerfile || | | `docker-langserver` |
| elixir || | | `elixir-ls` |
| elm || | | `elm-language-server` |
| erlang || | | |
| erlang || | | `erlang_ls` |
| fish |||| |
| git-commit || | | |
| git-config || | | |
Expand Down
7 changes: 4 additions & 3 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -939,15 +939,16 @@ source = { git = "https://github.com/jaredramirez/tree-sitter-rescript", rev = "
[[language]]
name = "erlang"
scope = "source.erlang"
injection-regex = "^erl$"
file-types = ["erl", "hrl", "app", "rebar.config"]
injection-regex = "erl(ang)?"
file-types = ["erl", "hrl", "app", "rebar.config", "rebar.lock"]
roots = ["rebar.config"]
comment-token = "%%"
indent = { tab-width = 4, unit = " " }
language-server = { command = "erlang_ls" }

[[grammar]]
name = "erlang"
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "86985bde399c5f40b00bc75f7ab70a6c69a5f9c3" }
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "1e81393b8f0a81b35ff1679a9420fafbd2cf3511" }

[[language]]
name = "kotlin"
Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/erlang/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(tuple
(binary_operator
left: (atom) @variable.other.member
operator: "="))
operator: ["=" "::"]))
(tuple
(binary_operator
left:
Expand Down Expand Up @@ -74,7 +74,7 @@
@keyword
"^(define|export|export_type|include|include_lib|ifdef|ifndef|if|elif|else|endif|vsn|on_load|behaviour|record|file|type|opaque|spec)$"))

["case" "fun" "if" "of" "when" "end" "receive" "try" "catch" "after"] @keyword
["case" "fun" "if" "of" "when" "end" "receive" "try" "catch" "after" "begin" "maybe"] @keyword

; Operators
(binary_operator
Expand Down

0 comments on commit e2a5071

Please sign in to comment.