Skip to content
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

rust-analyzer wants #165810

Open
1 of 5 tasks
Veykril opened this issue Nov 8, 2022 · 1 comment
Open
1 of 5 tasks

rust-analyzer wants #165810

Veykril opened this issue Nov 8, 2022 · 1 comment
Assignees

Comments

@Veykril
Copy link

Veykril commented Nov 8, 2022

The following is a small list of issues rust-analyzer would like to see fixed/implemented, I have been asked to create this issue for an upcoming VSCode meeting so that it can be tracked.

  • For long hovers, errors appear all the way at the bottom and require scrolling #73120 for Rust, this is one of the worst painpoints that exists in VSCode, especially since people tend to write very rich documentation, and it’s painful to scroll down to the error.
  • Have VSCode improve how it renders and exposes richer diagnostics. The Rust compiler (henceforth referred to as “rustc”) has incredibly nice diagnostics, but only when rendered in the terminal. rustc's diagnostics have a ton of information (something most languages do not have) and rendering these diagnostics in VSCode in a way that keeps them useful is basically impossible. It’s really common for Rust users to look at the compiler output by running their project manually in the terminal because the inline diagnostics don't show everything nicely, and more often than not, make things more confusing. (Just on Monday, November 7, one of the main people behind the diagnostics messages of rustc now commented on this matter). There are a few open issues that could make this situation better:
    Allow diagnostics messages to have markdown (or formatted text) content #54272 (comment) might allow rust-analyzer to render the output inside of VS Code as the Rust compiler renders diagnostics in the terminal.
    Custom peek widgets #3220 and/or Api for editor insets #85682: would allow rust-analyzer to render rustc-like diagnostics inline (in the style of Sublime’s Phantom Text). Implementing this feature would possibly be the diagnostics endgame for rendering Rust (and Rust-style) diagnostics.
  • make inlay hints typing debounce max delay configurable #145377: many users of rust-analyzer would love it if the debounce time was short and snappy as if it were when rust-analyzer implemented this feature using the decorator API. While the argument for the debounce time is that it makes updates on them less confusing and distracting, a lot of people get the impression that the server/client is rather unresponsive as the updates are no longer instantaneous.
  • A recent issue: when rust-analyzer returns a user-facing error via the ShowMessage LSP notification, rust-analyzer tells the user to check the error logs for more information, because it’s common to have too much information inside the pop-up/toast. To make this smoother, we would love to be able to add a button to the pop-up that switches the view to rust-analyzer’s log. Unfortunately, the LSP implementation of VSCode does not permit overwriting this functionality, as its immediately handled here: https://github.com/microsoft/vscode-languageserver-node/blob/ee58574201ba76d0da63b6826262220939996399/client/src/common/client.ts#L1001-L1015 preventing overwriting the message handlers for the notification in any form.
  • Diagnostics break for the entire file when an empty message is posted #155531: this is considered to be a still-unresolved issue by us, but it was locked for some reason. We feel that either VSCode has to verify the diagnostics coming from the LSP protocol and handle empty ones appropriately (whatever that my be), allow the client to somehow handle this case itself (currently the exception is thrown before the client receives the diagnostics) or the LSP has to define that error messages are not allowed to be empty. While this isn’t the biggest issue for rust-analyzer, it is legal for rustc to emit messages with no associated message. Worse, this can occur by accident on the user’s part. It is as simple as writing or emitting a compile_error!(""). rust-analyzer then immediately emits an empty diagnostic as that is what the macro states, causing diagnostics for the opened file to freeze and no longer update until that code is removed, which is not a great experience. The user expectation is that VS Code is resilient against such bugs, and to its credit, it is in nearly all cases.
@andreamah
Copy link
Contributor

I have been asked to create this issue for an upcoming VSCode meeting so that it can be tracked.

@Veykril Were you asked by a VS Code team member to create this list?

@kieferrm kieferrm assigned kieferrm and unassigned andreamah Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants