Diagnostics inline message not going away after fix
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
I noticed in the last few days that my inline diagnostics messages aren't going away anymore after I apply the fixes, not even after I save the file again. The only way to make them go is closing the buffer and reopening again, which is not a great experience when you're working iteratively.
In the example below, it should have gone after I provided the second argument, but it's still there.
Environment
Zed: v0.147.2 (Zed) OS: macOS 14.5.0 Memory: 16 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
I'm experiencing the same thing with typescript lsp.
Zed 0.160.7 MacOS 14.6.1 (Apple M1 Pro)
I have the same issue with Rust 🦀 and Rust-Analyzer LSP.
Here is my current workaround for this:
Config:
{
"context": "Editor",
"bindings": {
"cmd-s": ["workspace::SendKeystrokes", "cmd-s escape"]
}
}
- ⚠️ So, let's say there is a file with an error and a diagnostic message showing inline after
editor::GoToDiagnosticcommand. - 🛠️ I fix the error.
- 💾 I press
cmd-sto save the file. All diagnostic inline messages go away (both fixed the unfixed ones). - 🔁 I have to press the hotkey assigned to
editor::GoToDiagnosticagain to move on.
I also tried to do "alt-o": ["workspace::SendKeystrokes", "cmd-s escape alt-o"] where alt-o is bound to editor::GoToDiagnostic. But it didn't work because the key combination hits much faster than the language server rechecks and clears the diagnostic error for the fixed code. Some kind of delay before re-running the editor::GoToDiagnostic is required.
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!
The inline diagnostic messages now disappear after save.
I agree with @bofm, this looks like its fixed now. The diagnostic disappears when navigating away from it and when saving.
Environment Zed: 0.201.8 OS: macOS 15.6.1 Memory: 36 GiB Architecture: aarch64
Have tested on with Rust and Go with these examples.
Rust
use std::convert::From;
#[derive(Debug)]
struct Number {
value: i32,
}
impl From<i32> for Number {
fn from(item: i32) -> Self {
Number { value: item }
}
}
fn main() {
let num = Number::from("30");
println!("My number is {:?}", num);
}
Go
package main
import "fmt"
func intSeq() func() int32 {
i := 0
return func() int {
i++
return i
}
}
func main() {
nextInt := intSeq()
fmt.Println(nextInt())
fmt.Println(nextInt())
fmt.Println(nextInt())
newInts := intSeq()
fmt.Println(newInts())
}
Tested by doing
- Open the file, go to the error with
editor: go to diagnostic. - Fix the error and save.
- The diagnostic disappears, there are different behaviors, my guess is that this is because the LSPs operate differently. Both disappear when fixing the error though
- For Go it disappears as soon as I start removing 32 from int32.
- For Rust it disappears after saving.
@jader-rubini Can you retest?