-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
bootstrap: Consolidate editor setup into ./x setup editor & add support for vim, emacs & helix #131075
Conversation
This PR modifies If appropriate, please update |
f8c65f9
to
ec46b41
Compare
This comment has been minimized.
This comment has been minimized.
fd097d0
to
dea665f
Compare
Should be good now, I ended up with pretty substantial refactoring but I think it's cleaner this way. Returning editor-specific stuff from a method at runtime seems better than holding a ton of static variables on the other end of the file regardless of whether they actually end up being used or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly looked through this and it looks good to me in general, thanks! I'm not a bootstrap reviewer though so I'll hand it off to T-bootstrap reviewers.
r? bootstrap |
Add support for automatically setting up the recommended LSP config for Emacs. Additionally, refactor setup.rs to make it easier to add support for more editors in the future.
dea665f
to
9b24fae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few nits, but in terms of the bootstrap implementation, it looks fine to me.
I don't use or know any of these IDEs, so it's hard for me to validate the actual functionality though.
Onur has suggested that we might create a subcommand, e.g. x setup editor <editor-name>
, given that we now support multiple editors.
Once this is merged, we should also update https://rustc-dev-guide.rust-lang.org/building/quickstart.html?highlight=vscode#quickstart and https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc.
When running |
Consolidate LSP setup for different editors into one `./x setup editor`.
Working as intended now. I don't think we can avoid having an Editor struct for the Step separate from EditorKind, looks like putting them together would require a larger rework of the logic given that it's not the same case as with Profile. We can call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I think this is much better.
@onur-ozkan Just to be sure, are you okay with the x setup editor
approach?
If yes, this is ready to be merged I think.
match EditorKind::prompt_user() { | ||
Ok(editor_kind) => { | ||
if let Some(editor_kind) = editor_kind { | ||
while !t!(create_editor_settings_maybe(config, editor_kind.clone())) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The logic would be simpler to follow if the loop was directly inside create_editor_settings_maybe
, allowing to print the preview without having to call the function again.
But this was pre-existing, so it doesn't need to be changed in this PR.
Looks good to me, thanks for the ping. |
@bors r+ |
@mrkajetanp Could you please also update the rustc-dev-guide? :) E.g. here. |
Will do, no problem! Thanks for the reviews :) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (68301a6): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary 2.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -2.8%, secondary -3.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 774.957s -> 775.25s (0.04%) |
Add support for automatically setting up the recommended
LSP config for Vim (coc-nvim), Emacs (eglot) and Helix.
Additionally, refactor setup.rs to make it easier to add support
for more editors in the future.
As suggested,
r? @jieyouxu