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

tree-sitter-highlight 0.19.2 does not compile with tree-sitter 0.19.5 #1122

Closed
nitsky opened this issue May 21, 2021 · 2 comments
Closed

tree-sitter-highlight 0.19.2 does not compile with tree-sitter 0.19.5 #1122

nitsky opened this issue May 21, 2021 · 2 comments

Comments

@nitsky
Copy link

nitsky commented May 21, 2021

tree-sitter 0.19.4 contains a breaking change vs 0.19.3. The QueryCaptures struct now takes two generic lifetime arguments instead of one.

QueryCaptures in 0.19.4: https://docs.rs/tree-sitter/0.19.4/tree_sitter/struct.QueryCaptures.html
QueryCaptures in 0.19.3: https://docs.rs/tree-sitter/0.19.3/tree_sitter/struct.QueryCaptures.html

This broke my build when I ran cargo update on a codebase with the following in its Cargo.toml:

tree-sitter = "0.19"
tree-sitter-highlight = "0.19"

The latest published version of tree-sitter is 0.19.5 and the latest published version of tree-sitter-highlight is 0.19.2. tree-sitter-highlight 0.19.2 depends on the defintion of QueryCaptures from tree-sitter 0.19.2. Here is the compile error:

tree-sitter-highlight-0.19.2/src/lib.rs:104:30
104 |     captures: iter::Peekable<QueryCaptures<'a, &'a [u8]>>,
    |                              ^^^^^^^^^^^^^ -- supplied 1 lifetime argument
    |                              |
    |                              expected 2 lifetime arguments

Possible solutions:

  • Publish tree-sitter-highlight with the latest code.
  • Yank 0.19.4 and 0.19.5 and publish 0.20.

I look forward to tree-sitter reaching 1.0!

@ahlinc
Copy link
Contributor

ahlinc commented Sep 3, 2021

@nitsky In the #1363 (comment) I've described a workaroud.

@ahlinc
Copy link
Contributor

ahlinc commented Sep 9, 2021

tree-sitter-highlight was updated to v0.20.0, so closing this.

@ahlinc ahlinc closed this as completed Sep 9, 2021
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

2 participants