Commit Graph

39 Commits

Author SHA1 Message Date
Christian Clason
01dd4b05cf fix(check-queries): only show timings for existing queries 2025-05-30 16:23:44 +02:00
Christian Clason
ce903fde5d feat(api): expose list of available and installed languages 2025-05-29 12:11:56 +02:00
Christian Clason
0860b9b107 fix(config): check both installed parsers and queries
Problem: Can't uninstall custom parsers without queries since
`installed_parsers` only iterates over installed queries (to include
query-only languages, and to avoid string manipulation).

Solution: Iterate over both queries and parsers to collect list of
installed languages (optionally only queries or only parsers).
2025-05-29 11:52:58 +02:00
Christian Clason
53dccb3a77 feat(tests)!: new infrastructure based on makefile
Problem: Not easy to run all checks and tests locally. Redundant CI
workflows.

Solution: Separate CI into two workflows:
 * lint: Lua files (stylua, luals), query files (valid captures,
   predicates, directives using tsqueryls), docs
   (SUPPORTED_LANGUAGES.md) -- does not need parser installation
 * tests: parsers (ABI compatibility), query files (tsqueryls on
   Linux/macOS; nvim on Windows), highlight and indent tests (separated
   for better readability) -- needs parser installation (but only once)

Switch to https://github.com/nvim-treesitter/highlight-assertions fork
with ABI 15 support.

Run all tests (on Linux and macOS) through `make` (`formatlua`,
`checklua`, `lintquery`, `formatquery`, `checkquery`, `docs`, `tests`),
which downloads and caches all necessary dependencies.

Remove `update-readme` workflow (replaced by lint job on PRs).
2025-05-12 18:43:41 +02:00
Christian Clason
53d7118483 refactor(lua): fix some luals warnings 2025-05-12 18:43:40 +02:00
Christian Clason
c17de56890 feat!: track parser revision in Lua
Problem: Tracking parser revision in lockfile and allowing override
through the parsers module complicates the code. In addition, only
revision changes are handled robustly, not changes to other installation
info.

Solution: Track parser revision in the parsers module directly. Reload
parser table on every install or update call. Support modifying parser
table in a `User TSUpdate` autocommand.
2025-05-12 18:43:40 +02:00
Christian Clason
e77506bde3 feat: improve check-queries 2025-05-12 18:43:40 +02:00
Christian Clason
37957d6bcf refactor: use vim.uv 2025-05-12 18:43:40 +02:00
Christian Clason
9c0a99819c ci: remove update-lockfile shell script 2025-05-12 18:43:40 +02:00
Christian Clason
692b051b09 feat!: drop modules, general refactor and cleanup 2025-05-12 18:43:40 +02:00
Christian Clason
99ddf57353 feat(highlights)!: enforce documented captures (#6232)
Problem: Allowing undocumented "secret" (sub)captures makes it harder
to write comprehensive colorschemes and catch inconsistent captures.

Solution: Only allow captures listed in CONTRIBUTING.md. Add useful
(cross-language) subcaptures and drop language-specific or too niche
ones.

Follow-up: Adding further `*.builtin` captures and changing queries to
use them.

Language-specific subcaptures should instead be added in user config or
a custom language plugin.
2024-03-03 11:00:11 +01:00
Christian Clason
efda19a54a feat(tests): allow check-queries to take list of parsers
`./scripts/check-queries.lua foo bar baz`
2024-01-26 13:32:10 +01:00
Christian Clason
fc0fceb43a test(queries): print ALL errors at end 2024-01-19 16:58:37 +01:00
ObserverOfTime
f8bc6c69d7 ci: add shebangs to scripts 2023-08-18 11:09:57 +03:00
Christoph Sax
536c8a3880 feat(t32): re-enable tests
- Switch to GitLab mirror repository
- Lock grammar version 2.2.0
- Revert "fix(tests): mark t32 as allowed to fail"
  This reverts commit ba223ceecc.
- Revert "fix(tests): remove t32 tests"
  This reverts commit 97957a547b.
2023-07-30 19:29:33 +02:00
Christian Clason
ba223ceecc fix(tests): mark t32 as allowed to fail 2023-07-29 10:41:51 +02:00
Stephan Seitz
41e013dd9a ci: improve CI output on query error 2022-12-27 17:52:29 +01:00
Stephan Seitz
c8afa9fd3f ci: fix check for valid capture
Arguments to vim.startswith where swapped. Prefix has to go second.
2022-11-25 09:42:20 +02:00
Stephan Seitz
9bfaf62e42 ci: relax check for valid captures (only check prefixes) 2022-09-29 09:06:50 +02:00
Stephan Seitz
901b31f66c ci: don't skip swift anymore
I think this was a nvim 0.6 issue
2022-04-15 18:35:17 +02:00
Stephan Seitz
acdec99163 chore: update formatting for stylua update 2022-04-02 18:25:47 +02:00
dundargoc
f42b8a9d10 ci: make io_print accept nil as input argument (#2445)
Convert nil to an empty string, which mimicks the behavior of standard
print
2022-02-04 12:02:01 +01:00
Dundar Göc
6799824f6b ci: skip swift check on neovim stable
This is meant as a temporary workaround until neovim 0.7 is released.

More context: https://github.com/nvim-treesitter/nvim-treesitter/issues/2313#issuecomment-1025258357
2022-01-31 23:05:51 +01:00
Dundar Göc
10989cde1b ci: prefer io.write instead of print to have full control of output
This should prevent different output formats on windows and unix.
2022-01-31 21:17:33 +01:00
Dundar Göc
efedf3510a ci: add folds to CI output to better group related information 2022-01-30 22:52:10 +01:00
Stephan Seitz
19c56afc06 ci: print query loading times 2022-01-16 15:56:56 +01:00
Santos Gallegos
8ab1a5e5f7 CI: don't require to have parsers installed to check for injections 2021-08-01 13:16:38 -05:00
Santos Gallegos
be8f656087 Use stylua for autoformat code (#1480) 2021-07-04 21:12:17 +00:00
Santos Gallegos
c1f61d4ca1 Improve check-queries (#1253)
- Add checks for injections.
- Allow queries that start with [A-Z] for highlights only.
- Don't stop on the first error, finish checking all queries.
2021-05-31 17:03:27 +00:00
Stephan Seitz
8704b0f388 Allow failures for defined parsers 2021-04-22 18:37:04 +02:00
Stephan Seitz
966096b502 fix(CI): ensure parsers that don't require tree-sitter CLI are installed 2021-04-22 15:38:18 +02:00
Stephan Seitz
d727fffe41 Use installed parsers in CI check 2021-03-16 18:52:43 +01:00
Stephan Seitz
28bc7a0703 Skip parsers in query check that are not installed 2021-03-16 18:52:43 +01:00
Stephan Seitz
6cd211f647 Mark several invalid queries 2021-03-16 18:52:43 +01:00
Stephan Seitz
9b6b2543e8 Allow multiple errors in CI 2021-03-16 18:52:43 +01:00
Thomas Vigouroux
5d2b866518 ci: check capture names in queries 2020-09-11 12:02:35 +02:00
Stephan Seitz
31d1f068fd checkhealth for all query groups 2020-07-15 16:28:48 +02:00
Stephan Seitz
01c9f823f6 Also check textobjects queries in check-queries.lua 2020-07-14 22:34:43 +02:00
Stephan Seitz
c42c38a834 Add workflow for checking query files 2020-07-14 18:31:34 +02:00