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

File takes a long time to save (or doesn't save) when the LSP is not responding #9310

Closed
rdbo opened this issue Jan 10, 2024 · 3 comments
Closed
Labels
C-bug Category: This is a bug

Comments

@rdbo
Copy link

rdbo commented Jan 10, 2024

Summary

When I'm writing Rust code, sometimes helix won't write the file after I run :w or even :w!
This happens mostly when I'm running cargo run, which locks the LSP
In the bottom, I can see filepath/filename [+] after running :w, and sometimes it shows Async job failed and the file doesn't save.
This is very annoying because I assume that after :w the file has been saved so I start compiling again, just to learn that the file didn't change at all.

Reproduction Steps

I tried this:

  1. Run hx with rust-analyzer installed
  2. Add some dependencies to your project so that the cargo run command will take a little while to run
  3. Write someting to main.rs and run :w

I expected this to happen:
The file would be saved right after I ran the command

Instead, this happened:
The file gets stuck in a [+] state due to (I think) the LSP being stuck since cargo run is locking it.

Helix log

~/.cache/helix/helix.log
2024-01-10T19:59:27.206 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:28.189 helix_view::document [WARN] LSP formatting failed: request 173 timed out
2024-01-10T19:59:28.194 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:45.159 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:45.372 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:45.571 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:45.732 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:45.996 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.011 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.060 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.123 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.267 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.347 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.420 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.475 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.579 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.582 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.582 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:46.780 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.124 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.128 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.315 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.404 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.476 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.532 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.667 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.725 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.891 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:48.988 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.187 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.260 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.324 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.356 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.531 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.595 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.607 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.607 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.732 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.771 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.804 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:49.851 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:50.447 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.063 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.220 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.636 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.692 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.747 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.836 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.916 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:53.988 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.044 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.220 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.268 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.388 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.393 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.524 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.534 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:54.868 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.092 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.596 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.600 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.651 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.780 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.835 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.882 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:55.964 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.052 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.108 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.164 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.212 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.292 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.296 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.396 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.580 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.692 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.851 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:56.988 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.052 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.156 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.260 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.348 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.404 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.468 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.500 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:57.760 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:58.327 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:58.452 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:58.456 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T19:59:58.926 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:05.160 helix_view::editor [ERROR] editor error: Async job failed: request 174 timed out
2024-01-10T20:00:06.583 helix_view::editor [ERROR] editor error: Async job failed: request 176 timed out
2024-01-10T20:00:08.128 helix_view::editor [ERROR] editor error: Async job failed: request 177 timed out
2024-01-10T20:00:09.608 helix_view::editor [ERROR] editor error: Async job failed: request 179 timed out
2024-01-10T20:00:10.448 helix_view::document [WARN] LSP formatting failed: request 180 timed out
2024-01-10T20:00:10.453 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:13.064 helix_view::editor [ERROR] editor error: Async job failed: request 181 timed out
2024-01-10T20:00:15.601 helix_view::editor [ERROR] editor error: Async job failed: request 184 timed out
2024-01-10T20:00:16.298 helix_view::editor [ERROR] editor error: Async job failed: request 185 timed out
2024-01-10T20:00:18.328 helix_view::editor [ERROR] editor error: Async job failed: request 187 timed out
2024-01-10T20:00:18.458 helix_view::editor [ERROR] editor error: Async job failed: request 188 timed out
2024-01-10T20:00:18.927 helix_view::document [WARN] LSP formatting failed: request 189 timed out
2024-01-10T20:00:18.934 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:19.383 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:36.531 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:36.870 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:39.385 helix_view::document [WARN] LSP formatting failed: request 190 timed out
2024-01-10T20:00:39.390 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:00:56.871 helix_view::document [WARN] LSP formatting failed: request 191 timed out
2024-01-10T20:00:56.877 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:03:14.671 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:03:15.403 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:03:15.408 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:03:16.632 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2024-01-10T20:03:34.672 helix_view::editor [ERROR] editor error: Async job failed: request 192 timed out
2024-01-10T20:03:35.409 helix_view::editor [ERROR] editor error: Async job failed: request 193 timed out
2024-01-10T20:03:36.633 helix_view::document [WARN] LSP formatting failed: request 194 timed out
2024-01-10T20:03:36.640 helix_lsp::transport [ERROR] rust-analyzer err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })

Platform

Linux

Terminal Emulator

foot

Installation Method

Alpine packages

Helix Version

helix 23.10

@rdbo rdbo added the C-bug Category: This is a bug label Jan 10, 2024
@woojiq
Copy link
Contributor

woojiq commented Jan 11, 2024

Probably duplicate of #2059

@rdbo
Copy link
Author

rdbo commented Jan 11, 2024

Probably duplicate of #2059

Looks very similar, although I haven't really noticed issues with :q yet, only with writing files.

@rdbo
Copy link
Author

rdbo commented Jan 11, 2024

#1639 Looks like what I'm facing
I'll close this issue then

@rdbo rdbo closed this as completed Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants