Skip to content

Commit

Permalink
Add/improve textobject queries (#11513)
Browse files Browse the repository at this point in the history
* Add textobject queries for YAML

* Add textobject queries for SQL

* Add textobject queries for HOCON

* Add textobject queries for git-config

* Add textobject queries for env

* Add textobject queries for Dockerfile

* Add textobject queries for docker-compose

* Add textobject queries for prisma

* Add entry textobject queries for hcl

* Add entry textobject queries for Nix

* Update docs
  • Loading branch information
jpaju authored Aug 17, 2024
1 parent ff33b07 commit b90ec5c
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 8 deletions.
16 changes: 8 additions & 8 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
| devicetree || | | |
| dhall ||| | `dhall-lsp-server` |
| diff || | | |
| docker-compose || || `docker-compose-langserver`, `yaml-language-server` |
| dockerfile || | | `docker-langserver` |
| docker-compose || || `docker-compose-langserver`, `yaml-language-server` |
| dockerfile || | | `docker-langserver` |
| dot || | | `dot-language-server` |
| dtd || | | |
| earthfile |||| `earthlyls` |
Expand All @@ -46,7 +46,7 @@
| elixir |||| `elixir-ls` |
| elm ||| | `elm-language-server` |
| elvish || | | `elvish` |
| env || | | |
| env || | | |
| erb || | | |
| erlang ||| | `erlang_ls` |
| esdl || | | |
Expand All @@ -61,7 +61,7 @@
| gherkin || | | |
| git-attributes || | | |
| git-commit ||| | |
| git-config || | | |
| git-config || | | |
| git-ignore || | | |
| git-rebase || | | |
| gjs |||| `typescript-language-server`, `vscode-eslint-language-server`, `ember-language-server` |
Expand All @@ -83,7 +83,7 @@
| hcl |||| `terraform-ls` |
| heex ||| | `elixir-ls` |
| helm || | | `helm_ls` |
| hocon || || |
| hocon || || |
| hoon || | | |
| hosts || | | |
| html || | | `vscode-html-language-server` |
Expand Down Expand Up @@ -158,7 +158,7 @@
| pod || | | |
| ponylang |||| |
| powershell || | | |
| prisma || | | `prisma-language-server` |
| prisma || | | `prisma-language-server` |
| prolog | | | | `swipl` |
| protobuf |||| `bufls`, `pb` |
| prql || | | |
Expand Down Expand Up @@ -186,7 +186,7 @@
| sml || | | |
| solidity ||| | `solc` |
| spicedb || | | |
| sql || | | |
| sql || | | |
| sshclientconfig || | | |
| starlark ||| | |
| strace || | | |
Expand Down Expand Up @@ -228,6 +228,6 @@
| xit || | | |
| xml || || |
| xtc || | | |
| yaml || || `yaml-language-server`, `ansible-language-server` |
| yaml || || `yaml-language-server`, `ansible-language-server` |
| yuck || | | |
| zig |||| `zls` |
1 change: 1 addition & 0 deletions runtime/queries/docker-compose/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
; inherits: yaml
4 changes: 4 additions & 0 deletions runtime/queries/dockerfile/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(comment) @comment.inside

(comment)+ @comment.around

6 changes: 6 additions & 0 deletions runtime/queries/env/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(comment) @comment.inside

(comment)+ @comment.around

(variable_assignment
(_) @entry.inside) @entry.around
6 changes: 6 additions & 0 deletions runtime/queries/git-config/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(comment) @comment.inside

(comment)+ @comment.around

(variable
(_) @entry.inside) @entry.around
5 changes: 5 additions & 0 deletions runtime/queries/hcl/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
(function_arguments
((_) @parameter.inside . ","? @parameter.around) @parameter.around)

(attribute
(_) @entry.inside) @entry.around

(tuple
(_) @entry.around)
10 changes: 10 additions & 0 deletions runtime/queries/hocon/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(comment) @comment.inside

(comment)+ @comment.around

(pair
(_) @entry.inside) @entry.around

(array
(_) @entry.around)

3 changes: 3 additions & 0 deletions runtime/queries/nix/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
(function_expression
body: (_) @function.inside) @function.around

(binding
(_) @entry.inside) @entry.around

17 changes: 17 additions & 0 deletions runtime/queries/prisma/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(model_declaration
((statement_block) @class.inside)) @class.around

(call_expression
(arguments (_) @parameter.inside . ","? @parameter.around) @parameter.around)

(column_declaration) @entry.around

(array (_) @entry.around)

(assignment_expression
(_) @entry.inside) @entry.around

(developer_comment) @comment.inside

(developer_comment)+ @comment.around

4 changes: 4 additions & 0 deletions runtime/queries/sql/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(comment) @comment.inside

(comment)+ @comment.around

7 changes: 7 additions & 0 deletions runtime/queries/yaml/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(comment) @comment.inside

(comment)+ @comment.around

(block_mapping_pair
(_) @entry.inside) @entry.around

0 comments on commit b90ec5c

Please sign in to comment.