Skip to content
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

Cross platform support #1

Closed
jeff-hykin opened this issue May 23, 2019 · 4 comments
Closed

Cross platform support #1

jeff-hykin opened this issue May 23, 2019 · 4 comments

Comments

@jeff-hykin
Copy link
Owner

Use tree-sitter wasm to get cross platform support. (Done)

I'm mostly just making this issue to let you guys know about this. @EvgeniyPeshkov @georgewfraser Feel free to pull this into your own repo's its not super complex, I only made my own so that I could test and make changes easier. Everything in this repo is based on @EvgeniyPeshkov 's repo.

@georgewfraser
Copy link
Collaborator

Thanks for showing how to do this! I've updated https://github.com/georgewfraser/vscode-tree-sitter to use WASM so it supports all platforms now. I did some JS profiling and verified it has similar performance.

@EvgeniyPeshkov
Copy link

Hello @jeff-hykin , Thank you so much for your contribution.
WASM solution works perfectly. I've embedded it into the extension, now it works on all platforms.

I would like to share with you my workaround, that I've just finished. Maybe it will be helpful somewhere else.
It utilizes npmi. The idea was to publish version, pre-compiled for Windows, where it's hard to install build tools. And let extension recompile native modules on other OSes, where it's very likely, that g++ is already installed.

Your solution is waaay better. Thank you very much again.

@razzeee
Copy link

razzeee commented Jun 3, 2019

One thing I can't grasp about this, is that you guys don't seem to need to copy the wasm files to the out folder? I needed to do that to make it work, but i'm building a language server, so it might be rooted in that. elm-tooling/elm-language-server@f6f1966#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R37

The other problem at the moment is that descendantsOfType isn't implemented for wasm. Really surprised me, as I would have thought that your addons would use it this too. tree-sitter/tree-sitter#349 (comment)

@jeff-hykin
Copy link
Owner Author

That's a shame, I didn't know wasm was missing support for anything. To be honest though I don't know what the descendantsOfType is.

As for the /out folder, I think you can access the outside files, I think the path just needs to be relative from the /out folder. If it says it doesn't exist I'd try printing out the pwd or cwd to see if its a pathing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants