add textobject queries for erlang
commit7a9147489e8c058561bb37834c791b027fb0b4ae
authorMichael Davis <mcarsondavis@gmail.com>
dateWed 1 Jun 2022, 18:40 (4 years ago)
parent9f8df05
book/src/generated/lang-support.md+1−1
@@ -18,7 +18,7 @@
1818| elixir | ✓ | | | `elixir-ls` |
1919| elm | ✓ | | | `elm-language-server` |
2020| erb | ✓ | | | |
21−| erlang | ✓ | | | `erlang_ls` |
21+| erlang | ✓ | ✓ | | `erlang_ls` |
2222| fish | ✓ | ✓ | ✓ | |
2323| gdscript | ✓ | | ✓ | |
2424| git-attributes | ✓ | | | |
languages.toml+1−1
@@ -1049,7 +1049,7 @@ language-server = { command = "erlang_ls" }
10491049
10501050[[grammar]]
10511051name = "erlang"
1052−source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "481e7f8ddf27f07a47d1531b6e2b154b89ece31d" }
1052+source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "c0ebc82600caaf4339f2b00691f958e9df97c065" }
10531053
10541054[[language]]
10551055name = "kotlin"
runtime/queries/erlang/highlights.scm+1−1
@@ -58,7 +58,7 @@
5858 (#eq? @keyword "(spec|callback)"))
5959
6060; Functions
61−(function name: (atom) @function)
61+(function_clause name: (atom) @function)
6262(call module: (atom) @module)
6363(call function: (atom) @function)
6464(stab_clause name: (atom) @function)
runtime/queries/erlang/textobjects.scmnew file+8
@@ -0,0 +1,8 @@
1+(function_clause
2+ pattern: (arguments (_)? @parameter.inside)
3+ body: (_) @function.inside) @function.around
4+
5+(anonymous_function
6+ (stab_clause body: (_) @function.inside)) @function.around
7+
8+(comment (comment_content) @comment.inside) @comment.around