Closed thoughtpolice closed 3 weeks ago
This was actually a symptom of sysroot_src
being improperly configured for rust-project
, which is fixed by https://github.com/facebook/buck2/pull/756 (and it being OSS only would explain why much more complicated crate graphs worked just fine inside Meta)
I have a port of Jujutsu to use Buck2 instead of Cargo in this branch, and
rust-project
can almost get it working inside vscode and similar tools. However, there seems to be a dependency graph bug that prevents it from actually working.Put the following code inside
.vscode/settings.json
so that Visual Studio Code can open the project with Buck — I'll add this to the upstream branch after the next release on 9-1-2024, as it requires https://github.com/facebook/buck2/pull/745 (which was merged today):Now open
cli/src/cli_util.rs
and notice the red squiggly lines:The problem is this line:
commit_summary_template()
returns aTemplateRender
which implements aTemplate
trait containing aformat()
method: https://github.com/martinvonz/jj/blob/b05593fdf556f71da9fe636d573c98da36892dae/cli/src/templater.rs#L668However, with Buck, when I look at the original line in the editor, the error is under
.format()
, like in the above screenshot, because instead the call is resolved to a method initertools
instead https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.format — if I "Go to definition" on that bad method, it does in fact drop me inside theitertools
source code, so it does in fact look like the behavior is self consistent if nothing else.This seems to be the last major roadblock to getting
rust-project
working with Jujutsu, but it seems tricky, so I'm not sure what could be wrong. This may require further work inrust-analyzer
upstream to fix too, but I think this is a useful and important test case, at least!/cc @davidbarsky