-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How did you make the extension that depends on tree-sitter work cross-platform? #40
Comments
I learned a bit more detail about this here. IIUC, the reason the cross-platform issue is addressed is because the WASM bits are platform-independent. |
Thanks! I will check it out. |
@Symbolk jeff-hykin mentioned here about another VSCode extension that uses tree-sitter and WASM. I think it's this one: https://github.com/EvgeniyPeshkov/syntax-highlighter If you haven't had a look, may be it would be of interest to you -- it seems like it might be better maintained at this point in time. |
@jeff-hykin @sogaiu Hi, I managed to switch to web-tree-sitter in this way: Symbolk/somanyconflicts@47a94de I am not sure whether I am doing it correctly, though the debugging and running under macOS&Win10 seem basically good! However, there are some remaining issues that I need your help:
- const treeQuery = new TreeSitter.Query(specification, queryString)
+ const treeQuery = new TreeSitter.Query() But the query is necessary for my extension, is there anyway to use Query with query string?
Any hint is a great help! |
@Symbolk It's been quite a while since I've looked at these details so I'm not sure how much help I can be. There are a few things that occur to me though. For 1., IIUC, the web-tree-sitter tests seem to indicate that querying can be handed a string: https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/test/query-test.js#L57-L60 -- may be studying how that's done in that file could be helpful? For 2., IIUC, the elm folks use web-tree-sitter in their language server which is written in TypeScript: https://github.com/elm-tooling/elm-language-server/blob/main/package.json#L31 -- may be you can get some hints from looking in their source? One more thing is that the tree-sitter repository has a discussions area: https://github.com/tree-sitter/tree-sitter/discussions -- it might be that there are folks who can help you better there. Good luck! Sorry I don't have good answers for you. |
@sogaiu No, your answer is amazing! I think it solves the both problems! |
Thanks for the nice answers from you, loving Github! |
Hi, I am very excited to find this project! I am also developing a VSCode extension based on LSP and tree-sitter, which is used to help developers to resolve merge conflicts: https://github.com/Symbolk/somanyconflicts/
However, now I am in front of a severe issue: I am developing on mac, and I built and published it in the VSCode market, but according to my users, this version cannot be run on windows, for the error: "tree-sitter-runtime is not a valid Win32 Application". Therefore, I tried to rebuild the module and extension on windows, now it runs but the query will report error that do not exist on mac: 'Query error of type TSQueryErrorSyntax at position 1'
I saw yours depends on web-tree-sitter and somehow uses the WASM, but I failed to figure whether and how can this solve the cross-platform issue, can you help me? Ideally I do not want to have two versions for different OSs.
The text was updated successfully, but these errors were encountered: