-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
chore(deps): Update tree-sitter
dependencies to versions supporting Node 20
#235
base: main
Are you sure you want to change the base?
Conversation
…itter build --wasm"
This error was not caught by the TypeScript compiler because setLanguage has type (language: any) => void.
@kieran-ryan Test failures should be fixed now ( |
Thanks a bunch for the contribution first and foremost @cr7pt0gr4ph7 - and for a well-documented pull request; will be super to have this issue resolved! Will look to fully test and review soon as I can - as time allows off on the back of holidays. Checking, are you testing on Windows by any chance; or any other other detail you can provide on your runtime? Will try to replicate difference in test outcome between running locally and the pipeline. There are some disparities in testing with the project which require resolution at some point to improve the contributing experience. Suspect failing due to instability of query specifiers in tree-sitter language implementations (at least very early versions pinned in the package) which may have changed since with these updates - see Tree-sitter's live playground can be used to check the query and test data associated with a language-implementation for compatibility - compared to the older versions our queries were compatible with; though you may want to run a local tree-sitter playground against the specific language implementation versions you are running locally for accuracy as they may differ. |
Edit: @kieran-ryan Problem solved - I commited the query fixes but didn't push them. Oops 😅
I'm running on Linux Bluefin (Fedora-based) inside a Docker container:
The test failures which I could observe locally were partially due to syntax tree changes in
Thanks for the pointer! I actually looked for a Tree-sitter playground, but Google did not provide any helpful results. The manual page you linked does not even appear on the first page of results... |
@kieran-ryan Regarding further testing: I'd probably suggest updating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cr7pt0gr4ph7, would you be aware of the minimum supported version of VSCode following these changes; along with the range of supported node versions?
@cr7pt0gr4ph7, can for sure understand that perspective; would just be conscious of current users using the language server directly or through the VSCode extension that have pinned an earlier version of VSCode - as would autoupdate and could require promptly jumping on any fixes. |
I haven't modified anything related to communication with VS Code or upgraded any dependency beside It therefore all comes down to the compatibility between
You're absolutely right; I hadn't considered that scenario... |
I just had a look at the new CI test results, which seem good so far. A few notes:
So, in conclusion: It should likely be running just fine in VS Code 1.82.0, which uses Node 18.15.0. I'm unfortunately not able to verify this locally with an old version of VS Code due to the way my system is set up. |
I updated Based on the successful tests on Node 18.x and 20.x (and conditional on whether the tests for Node @kieran-ryan Thanks for the quick responses, very much appreciated! Edit: Would it make sense to define the official support policy of |
This PR upates the different
tree-sitter
dependencies to versions that are compatible with Node 19/20.Background
The previously used version
0.20.x
oftree-sitter
(the exact version number depends on the specifictree-sitter-*
sub-package) does not work on Node 19 and higher, leading to errors like the following:This broke e.g. the Official Cucumber VS Code extension when VS Code updated to a newer version of Node 19 (and later Node 20) that was not supported at the time by the
tree-sitter
library, but support has since been implemented and subsequently shipped intree-sitter
v0.21.0
and above.Should fix the
bad export type for ...
error once the updated version is includedcucumber/language-server
and thencucumber/vscode
that has been reported at least a couple times:Sidenote on versioning & compatibility of
tree-sitter
The versioning and release scheme of the
tree-sitter
libraries is a bit "messy": Thetree-sitter-typescript
/tree-sitter-rust
/... sub-libraries have a strong dependency on the major version number oftree-sitter
, such that versions of the component libraries that require different major versions of thetree-sitter
library cannot be used together. But they are:[email protected]
requires[email protected]
while[email protected]
requires[email protected]
).(though that does not strictly violate SemVer requirements due to still being a
0.x.y
development version).The approach taken here was to look for the newest version of
tree-sitter
for which all sub-libraries have at least one compatible release (which came out to be[email protected]
) and to choose the newest version of each sub-library that still supports[email protected]
(which eliminated a few of the most recent releases).Related PRs
This PR subsumes/replaces #225 as well as the following automated PRs (which have build failures due to trying to update the different dependencies separately):
tree-sitter
updated to0.21.1
instead of0.22.1
due to compatibility requirements, see below)tree-sitter-python
updated to0.23.4
instead of0.23.6
due to compatibility requirements, see below)Tests
Tested with a custom build of
cucumber/vscode
to work on my current VS Code version:A note on "missing import symbols" errors
If there are issues with missing import symbols (namely
missing symbol 'abort' from module 'env'
) after this update, this is due to a (too old) version ofemscripten
being used to compiletree-sitter
to WASM.The solution in that case is to install a newer version of
emscripten
.tree-sitter
currently usesemscripten v3.1.64
emscripten v3.1.74