From 7a9147489e8c058561bb37834c791b027fb0b4ae Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 1 Jun 2022 18:40:05 -0500 Subject: add textobject queries for erlang --- runtime/queries/erlang/highlights.scm | 2 +- runtime/queries/erlang/textobjects.scm | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/erlang/textobjects.scm (limited to 'runtime') diff --git a/runtime/queries/erlang/highlights.scm b/runtime/queries/erlang/highlights.scm index bea3871a..0cb60ca9 100644 --- a/runtime/queries/erlang/highlights.scm +++ b/runtime/queries/erlang/highlights.scm @@ -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) diff --git a/runtime/queries/erlang/textobjects.scm b/runtime/queries/erlang/textobjects.scm new file mode 100644 index 00000000..c46b5c6f --- /dev/null +++ b/runtime/queries/erlang/textobjects.scm @@ -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 -- cgit v1.2.3-70-g09d2