-
Notifications
You must be signed in to change notification settings - Fork 69
README: add two rust-analyzer configuration examples for Neovim users #9939
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
Open
sruggier
wants to merge
3
commits into
oxidecomputer:main
Choose a base branch
from
sruggier:pr/add-LazyVim-cargo.targetDir-example
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks for doing this.
Unfortunately my understanding is that this will cause each neovim instance to spawn an r-a process which can cause the system to run out of RAM rather quickly (r-a on Omicron routinely takes 12+ GB).
I wrote up a small tool which integrates lspmux with r-a to solve this issue:
https://github.com/sunshowers/lspmux-rust-analyzer. (We also have an internal variant of lspmux which isn't open source, and which I didn't realize existed before I wrote this.)
All of this is to say that I'm concerned about recommending something which makes it too easy for people to shoot themselves in the foot. Maybe one of us should work on productionizing some kind of lspmux + r-a thing, whether the FOSS version + my scripts or our integration.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks, also, for your response 🙂
To be fair, these snippets merely set
cargo.targetDirin rust-analyzer's config, whereas the behaviour of spawning r-a processes is triggered by installing the rustaceanvim plugin, or bootstrapping a LazyVim config and installinglang.rustfrom:LazyExtras.Still, that can be a lot of memory usage, and the added concurrency enabled by setting
targetDirwould increase the risk of thrashing somewhat. Not that I have any strong feelings about getting this merged, but I pushed a commit that adds a warning about the memory usage, with links to both of those repositories. It seemed like a relatively uncontroversial next step, but that's not to say I want to discourage any other feedback about it.I didn't attempt to mention the internal variant of lspmux: you can probably do a better job of that than I can, having some knowledge of where it lives. It's kind of funny, though, that you went from duplicate rust-analyzer processes to duplicate lspmux repositories.
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.
So, is there some kind of prize if I manage to beat the high score? I started loosely paying attention to rust-analyzer's memory usage after you mentioned it, and it's now above 17 GB on my system 😂
Uh oh!
There was an error while loading. Please reload this page.
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.
Another funny addendum here: the omicron codebase has made a Helix user out of me. The experience of navigating clippy diagnostics, at least in my Neovim setup, was too slow to incorporate into a development workflow, and it turns out Helix implements that in a much more useful way.
Edit: I'll add that based on my own experience using the two, I think it would even be reasonable to suggest to Neovim users interested in working with this codebase that they should consider switching to Helix.