Commit graph

124 commits

Author SHA1 Message Date
ObserverOfTime c70d6c2dfd fix(bindings): use custom class name
(cherry picked from commit 9d619d6fdc)
2025-08-08 12:38:41 +03:00
ObserverOfTime 462fcd7c30 fix(loader): fix no-default-features build (#4505) 2025-06-11 18:10:21 +02:00
dependabot[bot] b1a9a827d6 build(deps): bump emscripten to 4.0.4
(cherry picked from commit 12aff698b9)
2025-03-12 10:57:58 +01:00
WillLillis c313be63b2 fix(rust): adapt to new nightly lint
(cherry picked from commit 11071ed682)
2025-03-06 18:25:24 -05:00
ObserverOfTime 5cfeba9c0d feat(bindings): add opt-in zig bindings 2025-01-25 03:47:19 -05:00
Amaan Qureshi 46f8d1267c feat(init): add a title field to grammars 2025-01-25 03:20:43 -05:00
Amaan Qureshi bde94aed4d feat(init): add a class-name field to grammars 2025-01-25 03:20:43 -05:00
Amaan Qureshi 6dbcfdf282 feat(init): add an optional funding field 2025-01-25 03:20:43 -05:00
Yuri Astrakhan 9dbe165296 chore: a few minor lints
* do not use `&` for the format args as it cannot (yet) be optimized by the compiler
* a few format inlining
2025-01-21 00:57:58 -05:00
Yuri Astrakhan 48059b72a8 feat: remove lazy_static in favor of LazyLock
This switches to the built-in `std::sync::LazyLock`
2025-01-21 00:21:35 -05:00
dependabot[bot] 0e226561b1 build(deps): bump emscripten to 4.0.1 2025-01-20 23:27:25 -05:00
Guilherme Soares 207ef9796e
fix(wasm): check docker presence without arguments 2025-01-08 13:27:02 -05:00
WillLillis 07c08432ca fix(rust): use PathBuf for --query-paths highlight option
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
2025-01-04 04:12:24 -05:00
Amaan Qureshi b3183363a2 feat(loader): add a way to get the cwd's language config
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi 3456330fe9 fix: update outdated links 2025-01-03 15:09:33 -05:00
dependabot[bot] 2c064039c7 build(deps): bump emscripten to 3.1.74
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 16s
2025-01-02 22:10:49 -06:00
WillLillis faf97b896a fix(cli): use xdg config directory on macOS
fix: address feedback
2024-12-23 02:09:06 -05:00
Amaan Qureshi 9e1a2a701b fix(cli): correct default query paths 2024-12-15 23:05:54 -05:00
Amaan Qureshi e2d1e40a4d fix(cli): correct warning message 2024-12-15 23:05:54 -05:00
Amaan Qureshi 274e60a523
fix: clippy lints
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
2024-11-16 03:20:59 -05:00
Riley Bruins 78e5144f3f feat: generate schema in tree-sitter.json
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
2024-11-16 00:38:58 -05:00
Amaan Qureshi 015547c526 fix: compiler warning
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
2024-11-12 19:10:06 -05:00
Amaan Qureshi 18e4a2405b fix(loader): don't print warnings if the file is not found
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 12s
2024-11-10 04:53:22 +01:00
WillLillis 05b6871a02 feat(loader): support multi-barreled file extensions 2024-11-10 03:44:33 +01:00
Will Lillis 7b90dbf189
feat(loader): add error message when a tree-sitter.json file is invalid 2024-11-09 20:46:29 -05:00
Bastiaan Marinus van de Weerd 0dc1044d0d
feat(loader): add language_for_configuration 2024-11-09 15:09:50 -05:00
ObserverOfTime 8515986b73 docs(rust): document optional features 2024-10-24 17:08:55 +00:00
ObserverOfTime f9a4e8ecdc fix(init): use current path if unspecified 2024-10-19 19:28:51 +00:00
Amaan Qureshi 72f114fa12 perf(loader): improve language lookup speed 2024-10-12 03:08:57 -04:00
Amaan Qureshi 9c08edb066 build: configure clippy lints at the workspace level 2024-10-08 21:07:41 -04:00
Amaan Qureshi dbe8bbf480 feat: move scripts to xtasks 2024-10-08 21:07:41 -04:00
Will Lillis 5c6445edea
chore: misc clippy lints 2024-10-06 17:55:00 -04:00
Amaan Qureshi c611e15a31 chore(cli): minor correction in comments
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 14s
2024-10-05 01:41:05 -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
Amaan Qureshi ea3846a2c5
feat: move tree-sitter configuration to dedicated file (#3700) 2024-09-30 11:11:23 -04:00
Amaan Qureshi 871e8966c5 build: bump deps 2024-09-28 13:58:58 -04:00
Amaan Qureshi 52f696096d feat: provide a rebuild flag to force rebuild parsers 2024-09-24 11:27: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
Amaan Qureshi 9301d38b77 feat!: remove C++ support for external scanners 2024-09-07 20:14:36 -04:00
Ryan Patterson b5e4ef6d9a
clone wasm store engine (#3542)
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
This resolves https://github.com/tree-sitter/tree-sitter/issues/3454.

This brings the usage of wasmtime::Engine in line with how wasmtime
intends it to be used. All wasmtime functions that receive an Engine
always receive an `&Engine`, never an owned `Engine`.  They are always
responsible for cloning the reference if they need it.

This brings the usage of wasmtime::Engine in line with how TSParser
treats TSLanguages: when setting a language to the parser, the parser is
responsible for cloning the reference to the TSLanguage. It is
counterintuitive for TSParser to have different behavior when receiving
wasmtime_engine_t.

C API users also expect this behavior, see "Memory Management"
[here](https://docs.wasmtime.dev/c-api/wasm_8h.html). Talking about the
C API: without this change, failing to clone the `wasmtime_engine_t`
(which, again, is never something API users need to do in wasmtime) and
then reusing the engine in multiple TSLanguages results in a use after
free. With this change, failing to call `wasm_engine_delete` on your
owned Engine results in a memory leak. Memory leaks are safer than
use-after-free.
2024-08-22 08:01:37 -07:00
ObserverOfTime ce37b112dc build(wasm): bump emscripten to 3.1.64 2024-07-29 15:59:56 +03:00
Guillaume Bertholon 1c7b518b9d
build(loader): make dependencies optional (#1638)
The `tree-sitter-loader` crate currently always pulls
`tree-sitter-highlight` and `tree-sitter-tags` as dependencies.
However, apart from the tree-sitter CLI, most clients will not need both
of these libraries.

This commit makes the dependencies optional, but still includes them by
default in order not to break the backward compatibility.
2024-07-28 10:59:21 +03:00
阿良仔 9e0c922b3f
feat(cli): attach helpful context when grammar.json cannot be found
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-07-05 19:53:47 -04:00
Amaan Qureshi e553578696 feat: add fuzz subcommand 2024-05-30 23:00:45 -04:00
ObserverOfTime 636801770e feat(cli): add debug build flag 2024-05-17 16:12:56 -04:00
Amaan Qureshi 1e219ff9eb fix(cli): properly account for multi-grammar repos when using docker to build a wasm parser 2024-05-05 14:56:42 -04:00
ObserverOfTime a2d2da314d fix(cli): keep default cc flags in build 2024-05-05 13:06:45 -04:00
Amaan Qureshi dcb7acede4 build: update emscripten version 2024-04-11 22:35:43 -04:00
Amaan Qureshi abc7910381 refactor(rust): misc fixes & tidying 2024-04-11 22:35:43 -04:00
Amaan Qureshi 5825e24d56 style: wrap comments 2024-04-11 22:35:43 -04:00