Commit graph

5226 commits

Author SHA1 Message Date
Sergio A. Vargas
e4dec3d3d8
fix(generate): add *.scm section to .editorconfig template 2024-10-03 16:41:47 -04:00
Amaan Qureshi
99a0ddc4c2 fix(generate): remove unused rules 2024-10-03 16:40:51 -04:00
Amaan Qureshi
19c33b1ef7 fix(build): correct wasm root path lookup 2024-10-03 16:23:55 -04:00
Amaan Qureshi
8500e331eb fix(init): do not migrate package.json on error 2024-10-02 16:25:29 -04:00
ObserverOfTime
c3d45a0153 fix(init): don't prompt to reconfigure
This allows the command to be used in scripts or CI
2024-10-01 11:37:57 -04:00
ObserverOfTime
608506cb57 fix(init): fix some schema issues
- Validate CamelCase name, TextMate scope
- Skip serialization of unused properties
- Disallow additional properties in schema
2024-10-01 11:37:57 -04:00
Riley Bruins
0683136ca0 feat(api): expose function to check if symbol represents a supertype 2024-09-30 14:44:13 -04:00
ObserverOfTime
939e61c58d build(bindings): add CMakeLists.txt file 2024-09-30 14:43:55 -04:00
Amaan Qureshi
03313dbbf0 fix(bindings): lower go version to 1.22 2024-09-30 14:00:25 -04:00
Amaan Qureshi
f2e1aa3d72 fix(bindings): use RUST_BINDING_VERSION in Cargo.toml template 2024-09-30 14:00:25 -04:00
Amaan Qureshi
934a2814fd fix: deprecate child_containing_descendant and add child_with_descendant instead 2024-09-30 13:57:28 -04:00
Amaan Qureshi
2e3504a422
fix(cli): generate the parser version from the config as well 2024-09-30 13:23:43 -04:00
Amaan Qureshi
ea3846a2c5
feat: move tree-sitter configuration to dedicated file (#3700) 2024-09-30 11:11:23 -04:00
Yuta Saito
94a8262110 fix: exclude APIs that dup given file descriptors from WASI builds
WASI doesn't support `dup(2)` system call, so we cannot implement the
`print_dot_graph` and `print_dot_graphs` functions with exactly the same
semantics as in other platforms.
2024-09-29 23:01:41 -04:00
Ron Panduwana
a83b893016 fix: handle more cases of editing subtrees that depend on column values 2024-09-29 20:36:08 -04:00
Amaan Qureshi
2fffe036e0 fix: correct test name parsing when the prior test has equal signs 2024-09-29 19:58:00 -04:00
buckynbrocko
4dad379928 feat: add --overview-only to test subcommand 2024-09-29 18:49:51 -04:00
Jeong, Hun
bbc1370dd5 feat(lib)!: treat nodes' end ranges exclusively in goto_first_child_for_{byte,point}
This goes back on #1640, because now cursors are bi-directional, and
going to the previous sibling is simple.
2024-09-29 17:45:07 -04:00
Riley Bruins
b36ef4b7f4 fix(lib)!: child_containing_descendant now returns direct children
Previously, `child_containing_descendant` would return `null` when
called on a node's direct parent. In my opinion, this doesn't make much
sense; it seems like a node would contain itself. This (breaking)
commit changes the function so that it can return direct children.
2024-09-29 17:44:37 -04:00
Lukas Seidel
6b1ebd3d29
feat!: implement StreamingIterator instead of Iterator for QueryMatches and QueryCaptures
This fixes UB when either `QueryMatches` or `QueryCaptures` had collect called on it.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-09-29 17:34:48 -04:00
ObserverOfTime
12007d3ebe feat(init): add an update flag 2024-09-28 14:19:07 -04:00
Amaan Qureshi
871e8966c5 build: bump deps 2024-09-28 13:58:58 -04:00
ObserverOfTime
cd837df295 chore: update generate crate paths 2024-09-28 13:58:30 -04:00
ObserverOfTime
f212605dda refactor: improve the grammar schema
- Publish on the GitHub page
- Specify in the generated file
- Use const/enum instead of pattern
2024-09-28 13:58:30 -04:00
ObserverOfTime
ffc942a95b Update cli/src/main.rs
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2024-09-28 13:55:21 -04:00
ObserverOfTime
d0974e876e feat(generate): add a no-op --no-bindings flag 2024-09-28 13:55:21 -04:00
Amaan Qureshi
31f24395b4 feat: move generate logic to its own crate 2024-09-27 17:04:21 -04:00
Amaan Qureshi
90efa34608 chore: clippy fixes 2024-09-27 16:32:48 -04:00
Amaan Qureshi
b2359e4020 feat!: move generation of grammar files to an init command
The generate subcommand should stick to solely generating a parser and
headers.
2024-09-27 16:06:57 -04:00
Amaan Qureshi
50eaf0b6cd style(lib): add parameter names in declarations that are missing them 2024-09-27 13:38:08 -04:00
Amaan Qureshi
28972f916a fix(lib): silence warnings with -Wpedantic 2024-09-27 12:58:26 -04:00
Amaan Qureshi
0c43988a5e fix(lib): correct descendant-for-range behavior with zero-width tokens 2024-09-27 00:37:13 -04:00
Amaan Qureshi
9ef12624c3 feat(cli): add a no-ranges flag to the parse command 2024-09-26 22:43:01 -04:00
Amaan Qureshi
e04387258b feat(schema): misc improvements 2024-09-24 15:51:26 -04:00
Amaan Qureshi
86d3a5313d fix: disallow empty string literals in rules 2024-09-24 15:36:38 -04:00
Amaan Qureshi
1708a295a8 fix: do not generate spurious files if the grammar path is not the default path 2024-09-24 14:34:52 -04:00
Amaan Qureshi
bc072a52f8 refactor(cli): break out subcommand logic into separate functions
Co-authored-by: buckynbrocko <77247638+buckynbrocko@users.noreply.github.com>
2024-09-24 13:23:49 -04:00
Amaan Qureshi
1f0feb5254 feat: add shell completions 2024-09-24 12:46:38 -04:00
Amaan Qureshi
d3c262a104 fix(test): correctly handle assertions on empty lines
Also fixes assertions for captures spanning on multiple lines.

Co-authored-by: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
2024-09-24 12:36:33 -04:00
Amaan Qureshi
cc4378e751 feat(test): test all queries
Fallback to default testing for all queries present in the parser's
queries directory.

For a given query <QUERY>.scm, the test files are searched in
test/<QUERY>/*

Also mimic the output of other test-running subcommands when testing
queries.

Co-authored-by: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
2024-09-24 12:36:33 -04:00
dependabot[bot]
b695568516 build(deps): bump the cargo group with 3 updates
Bumps the cargo group with 3 updates: [cc](https://github.com/rust-lang/cc-rs), [clap](https://github.com/clap-rs/clap) and [thiserror](https://github.com/dtolnay/thiserror).


Updates `cc` from 1.1.20 to 1.1.21
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.20...cc-v1.1.21)

Updates `clap` from 4.5.17 to 4.5.18
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.17...clap_complete-v4.5.18)

Updates `thiserror` from 1.0.63 to 1.0.64
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.63...1.0.64)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 11:28:20 -04:00
Amaan Qureshi
52f696096d feat: provide a rebuild flag to force rebuild parsers 2024-09-24 11:27:59 -04:00
Samuel Tardieu
1aa28e04ee style(tests): do not use .as_bytes().len() on strings 2024-09-22 20:27:38 -04:00
Amaan Qureshi
c1f8a8a728 chore: remove compile_flags.txt 2024-09-22 20:26:51 -04:00
Amaan Qureshi
83d41542f8 feat: add eslint configuration package 2024-09-22 20:26:04 -04:00
Will Lillis
99dbbbcbe9
fix(fuzz): skip tests marked with :skip & don't report errors on tests marked with :error 2024-09-22 03:46:52 -04:00
Amaan Qureshi
4934a16173 feat: add root field in node-types.json 2024-09-22 01:48:03 -04:00
Amaan Qureshi
6f050f0da5 fix: properly handle utf8 code points for highlight and tag assertions 2024-09-22 01:03:59 -04:00
Joel Spadin
755e49e212 fix(wasm): use / paths for workdir
Reimplemented the fix from #2183 to fix building WASM files with Docker
on Windows again. The --workdir argument gives a path inside the Docker
container, so it must use forward slashes regardless of the default path
separator on the host OS.
2024-09-22 00:50:33 -04:00
Firas al-Khalil
4f0d463d49
build(make): support darwin cross-compile 2024-09-17 11:01:54 +03:00