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

Thoughts on fixing submodules #3

Open
lf- opened this issue Oct 9, 2022 · 7 comments
Open

Thoughts on fixing submodules #3

lf- opened this issue Oct 9, 2022 · 7 comments

Comments

@lf-
Copy link
Contributor

lf- commented Oct 9, 2022

It's very difficult to depend on tree-painter except by path, since cargo submodule support is awful, and it takes multiple minutes to full-depth clone everything on an 800mbit connection: rust-lang/cargo#7987 rust-lang/cargo#1171. This is a huge usability issue, unfortunately. Also, the rust bindings of any given tree-sitter parser are not necessarily maintained or consistent.

I think that Helix has fairly exhaustively explored the other ways to achieve it: it does all three of the following:

In sum, it looks like this will require some build engineering work, but it seems necessary to build it with Nix or really, depend on it in any scenario.

@matze
Copy link
Owner

matze commented Oct 12, 2022

For wastebin, I added tree-painter as yet another submodule. It's not nice at all from a setup point of view but it avoids the horrendous clone times.

P.S.: I saw your concerns regarding performance. Not sure what's wrong but when comparing syntect with tree-sitter, highlighting becomes an order of magnitude faster in release mode. Highlighting option.rs takes ~160ms with syntect but merely 13ms with tree-sitter.

@kaj
Copy link

kaj commented Jan 26, 2023

This does not seem to be a problem when depending on tree-painter through a crates.io release (currently 0.0.0), but it does seem to be a problem when trying to get newer code by git dependency?

# No problem
tree-painter = "0.0.0"

# Problem?
tree-painter = { git = "https://github.com/matze/tree-painter" }

Is that so? Or is it just that there were fewer modules in the 0.0.0 release?

@matze
Copy link
Owner

matze commented Jan 26, 2023

Or is it just that there were fewer modules in the 0.0.0 release?

Kind of. The thing is, if I want to make a crates.io release all dependencies must be on crates.io as well and of course have matching tree-sitter version requirements. Unfortunate reality is however that most grammars are not very keen on regular updates and some do not even provide Rust "bindings" even though they could. Hence the submodules which I could update on my own but then prevent me from making proper crates.io releases.

@kaj
Copy link

kaj commented Jan 28, 2023

Hm. Maybe there could be a tree-sitter-parser-collection crate that does all the required magic, that various crate that uses the parsers (like this one) could depend on?

@lf-
Copy link
Contributor Author

lf- commented Jan 28, 2023

that's something I'm working on slowly with lf-/gridlock, actually.

@matze
Copy link
Owner

matze commented Jan 29, 2023

If that's a repo, it is inaccessible :-(

@lf-
Copy link
Contributor Author

lf- commented Feb 17, 2023

@matze apologies for that, it is an unfinished side project and I was super busy and didn't get around to finishing it enough to make it usable-ish. It's now public: https://github.com/lf-/gridlock

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

3 participants