Commit graph

142 commits

Author SHA1 Message Date
Riley Bruins
37422b2df4 refactor: consolidate document data in one object 2025-04-29 19:56:02 -07:00
Riley Bruins
0a205a9682
fix(formatter): correct blank MISSING node format (#95)
The problem was we only stopped recurring when a node had no *named*
children. A blank MISSING node, however, has no named children but a few
unnamed children. This meant the entire node was treated as one "string
unit" so spaces inside it weren't being collapsed. This commit fixes
the formatter logic and adds some more test cases for this.
2025-04-29 18:08:19 -07:00
Riley Bruins
bcea9c4252
refactor: move large query strings into their own files (#94)
This commit also adds another test for formatting, and fixes an issue
where the final newline was not appended to a formatted document.
2025-04-29 18:05:00 -07:00
Riley Bruins
5d4a423384
feat!: separate "lints" from "checks" (#92)
Lints are independent of parser objects, and run solely based off of the
server configuration. Checks require access to the language object to
attempt a full query compilation.

Note that this commit makes it so that `check` no longer lints by
default.
2025-04-29 08:48:23 -07:00
Will Lillis
b9537e0be3
feat: code action to generate impossible pattern diagnostics (#89)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-04-29 07:38:49 -07:00
Riley Bruins
7f873c0d32 docs: mention the format flag for check
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-04-26 20:24:44 -07:00
Will Lillis
ca629075d3 feat(check): add flag to perform formatting checks 2025-04-26 20:24:44 -07:00
Riley Bruins
9d5e3da665
feat: check subcommand now validates using config (#86)
It now validates capture names, and predicates and directives
2025-04-26 14:23:07 -07:00
Riley Bruins
a118724a3a
docs: typo has -> any (#85) 2025-04-26 13:40:39 -07:00
Riley Bruins
f15b034e4c
feat: support not, has flags for predicate definitions (#84) 2025-04-26 12:32:43 -07:00
Riley Bruins
2d3520ca9f
feat!: simpler args for format subcommand (#82) 2025-04-26 09:51:27 -07:00
Riley Bruins
1b9026c13b
docs: note on check scans (#81) 2025-04-26 09:25:25 -07:00
Riley Bruins
4e0b56936a
docs: readme typo (#78) 2025-04-25 23:40:47 -07:00
Riley Bruins
9085fbc6c5
feat: hover for predicates, directives (#77)
Also renames the `varargs` type to `variadic`, because it makes more
sense. Not breaking becuz no release :rocket emoji:
2025-04-25 23:37:41 -07:00
Riley Bruins
16753cc394
feat: completion snippets for valid predicates, directives (#76) 2025-04-25 23:03:17 -07:00
Riley Bruins
38d690e4d7
feat: specify valid predicates, directives (#75) 2025-04-25 17:40:42 -07:00
Riley Bruins
3265f7537e
feat: completions for valid captures (#74)
This commit also improves the existing capture completions by adding
`TextEdit` support, meaning there are no longer any dodgy semantics
regarding whether or not the completion should slurp up the preceding
`@` sign.
2025-04-24 23:50:03 -07:00
Riley Bruins
baa0e1c21d refactor: use serde(default), remove optional indirection in Options 2025-04-22 22:29:08 -07:00
Riley Bruins
6612e42891 docs: README typo
sorry clason
2025-04-22 09:33:35 -07:00
Riley Bruins
80e317c12c fix: expand env variables at deserialization step
This allows `check` to also use env var expansion. This commit also
fixes an issue where the config file would not be read if the user
didn't pass in any configuration options during initialization.
2025-04-22 08:55:11 -07:00
Riley Bruins
a1d94fe604 feat: traverse up file tree to find config file 2025-04-21 22:11:16 -07:00
Riley Bruins
0aa1fe6a60 feat: support env var expansion for parser installation paths 2025-04-21 21:25:53 -07:00
Riley Bruins
fb30c4c7e7 refactor: move out formatting logic from util 2025-04-21 21:20:06 -07:00
Riley Bruins
a2d0b72545 fix!: rework allowable_captures
Rename to `valid_captures`, and change the type to a simple map from
capture name to capture description
2025-04-21 21:07:33 -07:00
Riley Bruins
6580213304 feat!: tsqueryrc.json -> .tsqueryrc.json
Configuration files should stay hidden.
2025-04-21 21:07:33 -07:00
Riley Bruins
dae06e36c6 chore: descriptions for captures in schema 2025-04-20 18:57:41 -07:00
Riley Bruins
eb3bc91478 feat: hover support for specified captures 2025-04-20 18:57:41 -07:00
Riley Bruins
2acb01d9fd chore: add rustfmt.toml 2025-04-20 16:22:42 -07:00
Riley Bruins
1c05df1e71 test: add diagnostics tests 2025-04-20 16:22:42 -07:00
Riley Bruins
1ddd90d2d4 refactor: move out the more specific util code 2025-04-20 16:22:42 -07:00
Riley Bruins
99b10a6cc1 feat: partial support for capture name validation
Currently not support by the `check` subcommand, nor autocompletions or
hover.
2025-04-20 15:33:23 -07:00
Riley Bruins
0d0b680ef8 chore: bump to 1.11.0 2025-04-20 09:38:15 -07:00
Riley Bruins
ad48630b8f feat: read from config file in check command 2025-04-20 09:22:11 -07:00
Riley Bruins
f403bd9a1d fix: merge parser installation path options 2025-04-20 09:22:11 -07:00
Riley Bruins
e15605a987 chore: format 2025-04-19 22:52:00 -07:00
Riley Bruins
974f9e9851 feat: generate schema for config file 2025-04-19 22:52:00 -07:00
Riley Bruins
457ed9efd5
feat: basic config file support (#59) 2025-04-19 21:35:20 -07:00
Riley Bruins
9203dfdacc
fix: use tracing crate for logging, make logs more succinct (#58) 2025-04-19 21:27:37 -07:00
Riley Bruins
a6d6f51ac2
feat: lazier query, regex parsing (#57) 2025-04-19 18:39:04 -07:00
Riley Bruins
88f4ed3263
refactor: remove lazy_static (#56) 2025-04-19 17:39:43 -07:00
Riley Bruins
43089e68c9
chore: bump tokio (#55)
Prior version had safety vulnerabilities
2025-04-19 16:30:05 -07:00
Riley Bruins
b327f7d67b
chore: bump to 1.10.0 (#51) 2025-03-10 16:03:35 -07:00
Riley Bruins
5e25fd7d55
feat: standalone linter (#50)
Allows the server to act as a standalone linter for query files. Useful
for CI.

Note that the linter ignores Rust-binding specific predicate errors,
since predicate usage is largely dependent on the implementation on the
consumer's side.
2025-03-10 15:56:10 -07:00
Riley Bruins
d5330a005b
feat: standalone formatter (ts_query_ls format) (#49)
Allows the language server to act as a standalone formatter by passing
the `format` argument. It will then take a list of directories to
format, and a formatting "mode" (whether to just check the files or
actually format them). Formatting is parallelized, and quite quick for
large query repositories like `nvim-treesitter`.
2025-03-10 10:25:59 -07:00
Riley Bruins
f39a4ea131
chore: bump to 1.9.0 (#48) 2025-03-09 17:43:24 -07:00
Riley Bruins
6ee9aa52b0
feat(diagnostics): clearer error messages (#47) 2025-03-08 10:09:35 -08:00
Riley Bruins
85ab782180 fix: prevent lots of cursor allocations during formatting
Now tree iteration uses one cursor formed at the root, and all children
iterate using that one cursor. Previously, each child would allocate its
own `TreeCursor` which was very expensive.
2025-02-12 08:49:57 -08:00
Riley Bruins
64adb71f43 chore: bump to 1.8.0 2025-02-11 11:29:01 -08:00
Riley Bruins
af15adec62 refactor: replace many helper functions with trait implementations 2025-02-11 10:56:25 -08:00
Riley Bruins
2b75de1e80 feat: document symbols 2025-02-11 09:12:45 -08:00