Comments (11)
I'm not saying users who consume the actual library in their code should use this versioning strategy, it's only for these grammar bindings that wish to be used by these consumers such that whatever major version they decide to go with works totally fine in either case. So I still don't see how this would break, your code that uses this Language
struct should be written for the appropriate version of tree-sitter (whether that be 0.20.10 or 0.21.0, or later on 0.22.0 etc). I think this is the easiest solution to prevent me having to manually update dozens of grammars every major update in the future, and really shouldn't cause breakage.
from tree-sitter-python.
This isn't really a bug, nor really a feature request, so both issue templates felt a little weird 😅
from tree-sitter-python.
Would be good to get an equivalent release of tree-sitter-python since the two versions need to match up.
[citation needed]
from tree-sitter-python.
[citation needed]
See the compiler error included in the post.
from tree-sitter-python.
That just means the lockfile has to be updated to the new release (or, in fact, the lockfile should never have pinned an exact version). It doesn't mean that tree-sitter-python needs a new version, nor that the version has to match that of tree-sitter exactly.
from tree-sitter-python.
No, that's not true. This is with a fully up-to-date lockfile. Rust (well, Cargo) considers different 0.x versions to be different major versions, and so when tree_sitter_python
returns a tree_sitter::Language
from tree_sitter 0.20.x
, that type is considered to be distinct from (and incompatible/non-interchangeable with) tree_sitter::Language
from tree_sitter 0.21.x
. Hence the error.
from tree-sitter-python.
Yes, which means that the crate needs to (correctly) declare compatibility with multiple versions.
from tree-sitter-python.
You're proposing
Line 24 in deba2ba
should be updated to something like
tree-sitter = ">= 0.20.10"
?
I'd generally caution against that — Cargo very quickly gets sad once version ranges that aren't just at semver major version boundaries are involved.
from tree-sitter-python.
That is what I'm proposing, yes, since the current pin is insane from a maintenance point of view.
And, again, nothing here implies that tree-sitter-python needs a release, especially not at the same version.
from tree-sitter-python.
I'd generally caution against that — Cargo very quickly gets sad once version ranges that aren't just at semver major version boundaries are involved.
Honestly, I think it's fine for this specific case, because tree_sitter is pulled in only to export the C function that returns a Language
. This type is just a wrapper around the C struct under the hood, and it will be fine to bump versions as this struct will almost never change, and if it does, it won't be in an incompatible way.
from tree-sitter-python.
In general, even if that kind of version range is appealing for exactly the reason you state, it also tends to come back to bite you in Rust, often in unintuitive ways. For example, since there will only be one major version of tree-sitter-python
across 0.20 and 0.21, and Cargo will have to pick one version of tree-sitter
to use, this will mean that consumers who may have multiple versions of tree-sitter
in their dependency graph quickly run into problems when trying to get them to interoperate. There's a reason why exactly this pattern is called out in the Cargo docs as something you should be very careful with.
That's not to say "definitely don't do this", just to be aware that you may end up having to change it back later :)
from tree-sitter-python.
Related Issues (20)
- Missing git tag for v0.20.2 HOT 2
- Two nodes with kind "lambda" in 0.20.2 HOT 1
- Parsing error in while loop HOT 3
- Cannot compile due to call to undeclared function 'static_assert' HOT 7
- Comment parsing HOT 2
- 3.12 "`type`" soft keyword (PEP 0695) HOT 1
- Extra indent when using an open bracket/parenthesis in string literal HOT 1
- Helping injected languages parse docstrings HOT 1
- Parameter highlight group doesn't capture references in body HOT 6
- Trailing comma in Annotated causes an error
- bug: Bad parse/behavior with docstring containing extraneous "-character HOT 1
- feature: doctest support HOT 2
- bug: Fail to parse type expression
- bug: Fail to parse from here but the online playground is fine HOT 1
- bug: Special case not managed by the parser, when an expression is split without a backslash and the second line is dedented.
- bug: arguments in Callable not marked as types HOT 3
- bug: `.1l` is not valid in python2 HOT 3
- feature: pre-compiled binary wheels for M chip macOS (arm64) HOT 8
- bug: CRLF line ending weirdness on checkout HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter-python.