Re: [PATCH v3] scripts: generate_rust_analyzer.py: add missing macros deps
From: Tamir Duberstein
Date: Wed Mar 05 2025 - 18:59:13 EST
On Wed, Mar 5, 2025 at 6:14 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Mon, Feb 10, 2025 at 6:03 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
> >
> > The macros crate has depended on std and proc_macro since its
> > introduction in commit 1fbde52bde73 ("rust: add `macros` crate"). These
> > dependencies were omitted from commit 8c4555ccc55c ("scripts: add
> > `generate_rust_analyzer.py`") resulting in missing go-to-definition and
> > autocomplete, and false-positive warnings emitted from rust-analyzer
> > such as:
> >
> > [{
> > "resource": "/Users/tamird/src/linux/rust/macros/module.rs",
> > "owner": "_generated_diagnostic_collection_name_#1",
> > "code": {
> > "value": "non_snake_case",
> > "target": {
> > "$mid": 1,
> > "path": "/rustc/",
> > "scheme": "https",
> > "authority": "doc.rust-lang.org",
> > "query": "search=non_snake_case"
> > }
> > },
> > "severity": 4,
> > "message": "Variable `None` should have snake_case name, e.g. `none`",
> > "source": "rust-analyzer",
> > "startLineNumber": 123,
> > "startColumn": 17,
> > "endLineNumber": 123,
> > "endColumn": 21
> > }]
> >
> > Add the missing dependencies to improve the developer experience.
> >
> > Fixes: 8c4555ccc55c ("scripts: add `generate_rust_analyzer.py`")
> > Reviewed-by: Fiona Behrens <me@xxxxxxxxxx>
> > Suggested-by: Chayim Refael Friedman <chayimfr@xxxxxxxxx>
>
> If this is a fix, then it should use Reported-by -- or the suggestion
> was about the implementation?
The most correct thing here would be Diagnosed-by 😅
> Anyway, I can fix it on my side, but I am also supposed to add a link
> to the report/suggestion -- do you have one?
https://github.com/rust-lang/rust-analyzer/issues/17759#issuecomment-2646328275
> Thanks!
>
> (Tested-by's welcome, by the way!)
>
> Cheers,
> Miguel
Thanks!
Tamir