-
Notifications
You must be signed in to change notification settings - Fork 32
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
expose rust-analyzer lint errors from invalid Cargo.toml #61
base: main
Are you sure you want to change the base?
Conversation
- remove the `stderr` handling from the `spawn` function - add a function `send_error_notification` to send error notifications to all clients - update the `stderr_task` function to accept an `instance` parameter - add a call to `send_error_notification` within the `stderr_task` function
thanks! I'd like to try it in a few editors to see if we won't need to be a bit smarter about buffering the input more than by lines. So we don't get multiple notification bubbles for one error message spread across multiple lines, which could hide each other and make the message hard to read. |
I'm trying to recreate the error messages you quoted in #60 (comment) but I can't 🤔 What editor are you using with ra-multiplex? There might be a capability it registers which helix does not for me. With the current rust-analyzer and logging notifications I got this in my logs:
I get a rather useless error in the stderr output of rust-analyzer but a very useful message with the What I might want to do, at least for my helix setup, is to allow ra-mulitplex to display notifications in system notifications via notify-send because helix apparently ignores |
hm seems like rust-analyzer is using a different method to show up the message for you.
I am using neovim with coc.nvim and rust-analyzer at nightly. notif: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"end"}}}
notif: {"jsonrpc":"2.0","method":"experimental/serverStatus","params":{"health":"error","message":"Failed to load workspaces.","quiescent":false}}
notif: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"cancellable":false,"kind":"begin","title":"Fetching"}}}
notif: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"cancellable":false,"kind":"report","message":"metadata"}}}
ERROR instance{pid=63552}: stderr line=2024-03-17T14:02:21.999612Z ERROR rust_analyzer::main_loop: FetchWorkspaceError:
ERROR instance{pid=63552}: stderr line=rust-analyzer failed to load workspace: Failed to load the project at /Users/falcucci/neovide/Cargo.toml: Failed to read Cargo metadata from Cargo.toml file /Users/falcucci/neovide/Cargo.toml, Some(Version { major: 1, minor: 78, patch: 0, pre: Prerelease("nightly") }): Failed to run `cd "/Users/falcucci/neovide" && RUSTUP_TOOLCHAIN="/Users/falcucci/.rustup/toolchains/nightly-aarch64-apple-darwin" "/Users/falcucci/.cargo/bin/cargo" "metadata" "--format-version" "1" "--manifest-path" "/Users/falcucci/neovide/Cargo.toml" "--filter-platform" "aarch64-apple-darwin"`: `cargo metadata` exited with an error: Updating crates.io index
ERROR instance{pid=63552}: stderr line=error: no matching package named `anyhow2` found
ERROR instance{pid=63552}: stderr line=location searched: registry `crates-io`
ERROR instance{pid=63552}: stderr line=required by package `neovide v0.12.2 (/Users/falcucci/neovide)`
ERROR instance{pid=63552}: stderr line=
ERROR instance{pid=63552}: stderr line=
notif: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"end"}}}
notif: {"jsonrpc":"2.0","method":"experimental/serverStatus","params":{"health":"error","message":"Failed to load workspaces.","quiescent":true}} as you can see it uses the and in my case yes, the only way I could see more details in the message popup was notifying our stderr. It would be nice if I could filter the most useful one tho. which rust-analyzer version are you using in helix? |
I'm using rust-analyzer shipped by rustup [language-server.rust-analyzer]
command = "/home/max/.cargo/bin/ra-multiplex"
args = ["client", "--server-path", "/usr/lib/rustup/bin/rust-analyzer"] Which through rustup then launches $ /usr/lib/rustup/bin/rust-analyzer --version
rust-analyzer 1.78.0-nightly (766bdce 2024-03-16) |
@pr2502 that's super weird, I have the same rust-analyzer version. I also tried to reinstall just to make sure but it still uses It's important to note that zed editor have done something similar using the |
or we are missing something we didn't notice still |
currently the pop-up is shown as a generic error
Failed to load workspaces
in case you type a wrong crate name, for example, which makes it confusing to understand.A more detailed notification would be appreciated.