Open fabjan opened 3 months ago
I've been suffering from similar problems and if you still have this problem, my solution is that the tree-sitter grammar I'm using is using an external C++ scanner, and the C++ API is said to be deprecated, so I switched it to C, and boom, all things runs perfectly. Hope this helps :)
Porting the scanner to C seems to have fixed the issue for me, thanks!
Also worth noting that the Tree-sitter API now features tree_sitter/array.h
as a canonical implementation of a generic dynamic array, which was not too hard to adapt from the previously std::vector
-based implementation of the scanner I ported.
Check for existing issues
Describe the bug / provide steps to reproduce it
I'm trying to make an extension for the Standard ML language, using this Tree-sitter grammar that someone has already made: https://github.com/stonebuddha/tree-sitter-sml
But something is not right in the way the parser gets compiled. When loading the extension Zed cannot instantiate the wasm module because the external scanner symbols are not available.
Steps to reproduce
Notes
I am not very familiar with Tree-sitter, I may be misunderstanding something. A large language model I asked about this is telling me I need to fix the export.
This is what wasm-objdump says about the compiled module:
Is something missing in my configuration, or does the compile_grammar function need to know more about what to export? https://github.com/zed-industries/zed/blob/cd9b25d82728d2c8f2537db3ceccc5e211e8146e/crates/extension/src/extension_builder.rs#L211
Environment
Zed: v0.144.4 (Zed) OS: macOS 14.5.0 Memory: 8 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log