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

Update r-a config suggestions #1473

Merged
merged 1 commit into from
Oct 1, 2022
Merged

Update r-a config suggestions #1473

merged 1 commit into from
Oct 1, 2022

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Oct 1, 2022

The proc-macro server path is required for proc-macros to properly work in r-a when working on rustc.
Pointing the sysroot to the stage0 one is more correct than using the system installed one.

Related PRs in rust-analyzer:
rust-lang/rust-analyzer#13327
rust-lang/rust-analyzer#13326

Note, these configs only work with the next r-a release, that is tomorrows nightly, or next monday's stable release!

The proc-macro server path is required for proc-macros to properly work in r-a when working on rustc.
Pointing the sysroot to the stage0 one is more correct than using the system installed one.
@Veykril
Copy link
Member Author

Veykril commented Oct 1, 2022

I also just realized, for people working on the library crates, that is std and the like, it is beneficial to set "rust-analyzer.cargo.sysroot": null, as that will make r-a not consider the sysroot at all, getting rid of a bunch of incorrect type mismatches (as well as making most ide functions like goto definition work with the correct library definition, instead of the sysroot one).
I am unsure how to mention this library dev specific set up though, I assume there is no separate config suggestion for library devs?

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jyn514
Copy link
Member

jyn514 commented Oct 1, 2022

I also just realized, for people working on the library crates, that is std and the like, it is beneficial to set "rust-analyzer.cargo.sysroot": null, as that will make r-a not consider the sysroot at all, getting rid of a bunch of incorrect type mismatches (as well as making most ide functions like goto definition work with the correct library definition, instead of the sysroot one). I am unsure how to mention this library dev specific set up though, I assume there is no separate config suggestion for library devs?

Why would this be specific to working on the standard library?

@Veykril
Copy link
Member Author

Veykril commented Oct 1, 2022

the library crates don't depend on the sysroot library crates if I understand this correctly, but instead on each other only. With the sysroot set r-a will still resolve some things in those crates to the sysroot (mainly associated items on primitives) instead of the corresponding library crate.

Not too relevant here though I believe, just on observation I made.

@jyn514
Copy link
Member

jyn514 commented Oct 1, 2022

ah, I see. I think the proper solution for that is for rust-analyzer to understand #[lang = "slice_impl"] and such, otherwise it still won't work when people only run x.py check std and not x.py build std.

But yeah let's put that off for another day.

@jyn514 jyn514 merged commit ed11720 into rust-lang:master Oct 1, 2022
@Veykril Veykril deleted the patch-2 branch October 1, 2022 20:49
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

Successfully merging this pull request may close these issues.

2 participants