Debugging tree-sitter syntaxes

I tried to migrate from a home-made Regex syntax to use tree-sitter-svelte. I successfully compiled the parser by using the build script provided on the doc site (SvelteNova/build_scripts at main · laosb/SvelteNova · GitHub), but with a very basic highlight query it doesn’t appear to do anything. In the extension console there’s nothing about the tree-sitter parser so I’m not sure what part of this was wrong. Is there any log we can find to at least see if it’s a problem on my binary, or my tree-sitter query? (I’m very new to tree-sitter so I doubt I can write all things correct on the first try)

Is Nova 10 released already? Tree-sitter support is new in Nova 10.

v10 and tree-sitter is currently in closed beta testing

Hello Shibo,

After checking, it appears that our logging functionality for Tree Sitter errors may not be working properly. Ideally, they should appear in the Extension Console as you say, but there’s an issue preventing them from being routed. We’ll get this fixed in beta 2.

As for the issue you’re encountering: It appears our documentation is slightly wrong. It instructs you to build a library named tree-sitter-<name>.dylib, but in actuality this should be libtree-sitter-<name>.dylib (note the lib prefix). Sorry about that, we’ll get those docs updated right away.

Logan

1 Like

After the name change it works.

However, injections don’t seem to work for me. I’ll wait for beta 2 to see more debug info.