Skip to content

Commit

Permalink
add textobject queries for erlang
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Jun 6, 2022
1 parent 8351a82 commit 2e87827
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 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 @@ -18,7 +18,7 @@
| elixir || | | `elixir-ls` |
| elm || | | `elm-language-server` |
| erb || | | |
| erlang || | | `erlang_ls` |
| erlang || | | `erlang_ls` |
| fish |||| |
| gdscript || || |
| git-attributes || | | |
Expand Down
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ language-server = { command = "erlang_ls" }

[[grammar]]
name = "erlang"
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "481e7f8ddf27f07a47d1531b6e2b154b89ece31d" }
source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "c0ebc82600caaf4339f2b00691f958e9df97c065" }

[[language]]
name = "kotlin"
Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/erlang/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
(#eq? @keyword "(spec|callback)"))

; Functions
(function name: (atom) @function)
(function_clause name: (atom) @function)
(call module: (atom) @module)
(call function: (atom) @function)
(stab_clause name: (atom) @function)
Expand Down
8 changes: 8 additions & 0 deletions runtime/queries/erlang/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(function_clause
pattern: (arguments (_)? @parameter.inside)
body: (_) @function.inside) @function.around

(anonymous_function
(stab_clause body: (_) @function.inside)) @function.around

(comment (comment_content) @comment.inside) @comment.around

0 comments on commit 2e87827

Please sign in to comment.