aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Davis2022-03-02 14:54:44 +0000
committerBlaž Hrastnik2022-03-30 04:24:53 +0000
commite2a50711d5ca1029b28b1ddaeb3b2989ade7d651 (patch)
tree9d11902104d1e4da3540ad4580af03c09a7d3ecf
parentf2dd3d446914ec0953cd7e056d430fc3b959e75d (diff)
update tree-sitter-erlang
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
-rw-r--r--book/src/generated/lang-support.md2
-rw-r--r--languages.toml7
-rw-r--r--runtime/queries/erlang/highlights.scm4
3 files changed, 7 insertions, 6 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 03a96952..35a10c0f 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -11,7 +11,7 @@
| dockerfile | ✓ | | | `docker-langserver` |
| elixir | ✓ | | | `elixir-ls` |
| elm | ✓ | | | `elm-language-server` |
-| erlang | ✓ | | | |
+| erlang | ✓ | | | `erlang_ls` |
| fish | ✓ | ✓ | ✓ | |
| git-commit | ✓ | | | |
| git-config | ✓ | | | |
diff --git a/languages.toml b/languages.toml
index 265f462d..9c1a4334 100644
--- a/languages.toml
+++ b/languages.toml
@@ -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"
diff --git a/runtime/queries/erlang/highlights.scm b/runtime/queries/erlang/highlights.scm
index fc742f3a..067e0f82 100644
--- a/runtime/queries/erlang/highlights.scm
+++ b/runtime/queries/erlang/highlights.scm
@@ -22,7 +22,7 @@
(tuple
(binary_operator
left: (atom) @variable.other.member
- operator: "="))
+ operator: ["=" "::"]))
(tuple
(binary_operator
left:
@@ -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