Code actions list is incomplete (Rust) #7613
-
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
I see in the logs that the advertised code actions don't include the same as I was finding with
I have a |
Beta Was this translation helpful? Give feedback.
-
I can't reproduce this the codeactions all show up for me. There isn't much to requesting code actions, we send a request to the server and display the results. You don't need to configure RA specifically in any way. If you mean the sort order then kak-lsp seems to sort alphabetically while heilx takes the order of code actions specified by the server into account (which is actually more correct and what VSCode does too). I am guessing that the RA version you are using with kak-lsp is not the same as the one you are using with helix |
Beta Was this translation helpful? Give feedback.
-
I'm referring to the contents, the sort order doesn't matter to me. In particular I'm missing:
Curiously I just noticed kak-lsp misses The rust-analyzer version appears to be the same, insofar as the same binary is being used between kak-lsp and helix.
|
Beta Was this translation helpful? Give feedback.
-
VSCode shows all code actions as I'd expect. I tried also building Helix from source, but the issue remains. In desperation I tried inside a container, and I was able to reproduce it still. perhaps try this container and let me know if you are able to reproduce? FROM docker.io/library/ubuntu:jammy
RUN apt update
RUN apt install -y curl tar xz-utils wget
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN /root/.cargo/bin/rustup component add rust-analyzer
RUN wget https://github.com/helix-editor/helix/releases/download/23.05/helix-23.05-x86_64-linux.tar.xz
RUN tar xvf helix-23.05-x86_64-linux.tar.xz --strip-components 1 -C /root
RUN mv /root/hx /usr/bin
RUN /root/.cargo/bin/cargo new foo
WORKDIR /foo Invoke with |
Beta Was this translation helpful? Give feedback.
-
Good news! In my container I tried installing the 1.65.0 toolchain, giving me I do think this is a Helix-specific problem, in that both kak-lsp and VSCode are showing all actions even on the latest toolchain. (Also curiously VSCode gives me an additional |
Beta Was this translation helpful? Give feedback.
-
this seems to be a temporary regsession in rust-analyzer. The problem does occur with stable RA versions (1.66-1.70) but not when building from source (and presumably not with nightly). Note that RA made some changes to the way code actions work so you now get different sets of code actions depending on whether you place the cursor on the struct name, field name or field type. Furthermore, RA hs introduced an LSP extension to group certain code actions together (getter/setters in this case). Helix doesn't support unofficial LSP extensions. That shouldn't be an issue because RA should just send the code actions anyway just without the group property but instead the corresponding code actions are just missing which seems to be another RA bug. I think I have a pretty good idea what caused the bug in FA in the past, helix treats workspace roots slightly differently (uses a newer version of the spec/more correctly). None of these have anything to do with helix. i would usually advise using RA nightly (the vscode plugin does that by default). The getter/setter problem should likely be reported upstream (i suspect the same problem would occur with kak-lsp too unless it implements to RA specific extensions like the VSCode plugin) |
Beta Was this translation helpful? Give feedback.
this seems to be a temporary regsession in rust-analyzer. The problem does occur with stable RA versions (1.66-1.70) but not when building from source (and presumably not with nightly). Note that RA made some changes to the way code actions work so you now get different sets of code actions depending on whether you place the cursor on the struct name, field name or field type.
Furthermore, RA hs introduced an LSP extension to group certain code actions together (getter/setters in this case). Helix doesn't support unofficial LSP extensions. That shouldn't be an issue because RA should just send the code actions anyway just without the group property but instead the corresponding code actio…