rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Configuration manual missing non-default variants for `hover.memoryLayout.*` configs

Open chrisp60 opened this issue 1 year ago • 2 comments

Hello, partial issue, partial question.

When configuring my LSP, I noticed that the below configurations show their default values, but do not show other valid values (variants).

I believe there are 3 configurations in the memoryLayout category that are guilty of this.

The config assumes the end user is familiar with common representations of memory. I am sure most are, but maybe explicitness is preferred

Config items without information on variants.

These configs were deemed reasonable around #14918. #14929 is when they were actually implemented. Interestingly, the latter of those PRs include a json file showing the variants for VSCode settings. Maybe it was forgotten for the reference on the website

If a PR is welcome, I can try to poke at it, I'm very unfamiliar with RA internals. Don't mind learning something new though. If people feel it is not worth the time, feel free to close

AFAICT - Currently, you must search the repo to learn of the possible values. That could feel annoying for a new user to do

chrisp60 avatar Oct 06 '24 14:10 chrisp60

It looks like the manual doesn't document variants for any config option, not just these. It doesn't look easily fixable, because the only place we have descriptions for the variants is in the enumDescriptions for the package.json: https://github.com/rust-lang/rust-analyzer/blob/0fb804acb375b02a3beeaceeb75b71969ef37b15/crates/rust-analyzer/src/config.rs#L3307-L3311

darichey avatar Oct 12 '24 05:10 darichey

Hmm that's unfortunate. Maybe a decent half-measure exists by just stating where each variant can be found.

It's possible that this issue can just be ignored. I feel anyone that is tinkering with their lsp config outside of their editor's blanket is willing to go searching for the answers.

FWIW my editor does show the variants through a plugin (neovim with Mason). So maybe it is fine as it is.

A maintainer can weigh in / close this if they feel there are more pressing matters

chrisp60 avatar Oct 15 '24 12:10 chrisp60