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

bash files Error: Timed out waiting for language servers to shutdown #5117

Closed
geometryolife opened this issue Dec 11, 2022 · 8 comments
Closed
Labels
C-bug Category: This is a bug

Comments

@geometryolife
Copy link

Summary

First: Open the .sh file, the time to use the :q to exit becomes very long, it takes about 3 seconds
Second: After exiting helix, Error: Timed out waiting for language servers to shutdown is output on stdout

Reproduction Steps

I tried this:

  1. hx git-email.sh
  2. :q

I expected this to happen:

  1. The language server should work fine
  2. Exit should not be delayed

kk

  1. Unable to use bash language service properly
  2. Exit delay of three to five seconds

Helix log

~/.cache/helix/helix.log
2022-12-11T15:10:12.491 helix_loader [DEBUG] Located configuration folders: ["/home/joe/i/100/.helix"]
2022-12-11T15:10:12.544 helix_view::clipboard [DEBUG] Using win32yank.exe to interact with the system clipboard
2022-12-11T15:10:12.598 mio::poll [TRACE] registering event source with poller: token=Token(0), interests=READABLE | WRITABLE
2022-12-11T15:10:12.598 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
2022-12-11T15:10:12.598 mio::poll [TRACE] registering event source with poller: token=Token(2), interests=READABLE | WRITABLE
2022-12-11T15:10:12.599 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"22.12 (0e8ea136)"},"processId":17203,"rootPath":"/home/joe/i/100","rootUri":"file:///home/joe/i/100","workspaceFolders":[{"name":"100","uri":"file:///home/joe/i/100"}]},"id":0}
2022-12-11T15:10:12.599 helix_view::editor [DEBUG] editor status: Loaded 1 files.
2022-12-11T15:10:12.599 mio::poll [TRACE] registering event source with poller: token=Token(3), interests=READABLE | WRITABLE
2022-12-11T15:10:12.599 mio::poll [TRACE] registering event source with poller: token=Token(4), interests=READABLE | WRITABLE
2022-12-11T15:10:12.599 mio::poll [TRACE] registering event source with poller: token=Token(0), interests=READABLE
2022-12-11T15:10:12.599 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE
2022-12-11T15:10:12.600 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2022-12-11T15:10:12.906 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Initialized server v. 4.1.0 for file:///home/joe/i/100"}}
2022-12-11T15:10:12.907 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "window/logMessage", params: Map({"message": String("Initialized server v. 4.1.0 for file:///home/joe/i/100"), "type": Number(4)}) })))
2022-12-11T15:10:12.907 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Log, message: "Initialized server v. 4.1.0 for file:///home/joe/i/100" }
2022-12-11T15:10:12.907 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2022-12-11T15:10:12.945 helix_term::application [DEBUG] received editor event: IdleTimer
2022-12-11T15:10:14.097 helix_term::commands::typed [DEBUG] quitting...
2022-12-11T15:10:14.097 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2022-12-11T15:10:14.097 helix_term::job [DEBUG] waiting on jobs...
2022-12-11T15:10:14.097 helix_term::job [DEBUG] waiting on jobs...
2022-12-11T15:10:14.098 helix_lsp::transport [INFO] Language server not initialized, delaying request
2022-12-11T15:10:17.099 helix_term::application [ERROR] Timed out waiting for language servers to shutdown
2022-12-11T15:10:17.104 mio::poll [TRACE] deregistering event source from poller
2022-12-11T15:10:17.104 mio::poll [TRACE] deregistering event source from poller
2022-12-11T15:10:17.104 mio::poll [TRACE] deregistering event source from poller
2022-12-11T15:10:17.104 mio::poll [TRACE] deregistering event source from poller
2022-12-11T15:10:17.104 mio::poll [TRACE] deregistering event source from poller

Platform

WSL2 of Ubuntu

Terminal Emulator

windows-terminal

Helix Version

helix 22.12 (0e8ea13)

@geometryolife geometryolife added the C-bug Category: This is a bug label Dec 11, 2022
@usrme
Copy link

usrme commented Dec 11, 2022

I just ran into the same issue while opening a go.mod file, changing the package name, and saving the changes with :x.

Helix log

Unfortunately I don't have debug logs enabled, but if someone guides me on how to do so, then I'll happily enable them to make future debugging easier.

2022-12-11T11:21:30.850 helix_term::application [ERROR] Timed out waiting for language servers to shutdown

Platform

Fedora 36:

$ uname -a
Linux fedora 6.0.11-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Dec 2 20:38:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Terminal emulator

Konsole:

$ konsole --version
konsole 22.08.3

Helix version

Installed from master.

$ hx --version
helix 22.12 (0e8ea136)

Additional information

I didn't immediately think of this, but the most likely culprit is an overloaded CPU as I'm currently encoding a video and all of my 8 cores are almost fully utilized. Curiously though, even if I just open the go.mod file and close it with :q, then there is no error, but if I use :x then it errors out. If I open any random Go file then neither :q nor :x result in an error. Just the go.mod file seems to do so.

After the CPU usage has gone drastically the closing of any Go files, including go.mod, no longer errors, but the closing still isn't immediate with :q or :x.

@the-mikedavis
Copy link
Member

This is another instance of #2059, I'll close in favor of that issue. There are two underlying problems that have the same symptoms discussed in #2059 (and here too):

You can see in the log that the server doesn't send back the initialized LSP message. We don't send the shutdown request to the language server because the server isn't initialized so we just wait until we hit the timeout. We should recognize the case where the language server isn't initialized and just exit (rather than sending shutdown and exit messages).

@usrme that is a different issue - :wq or :x write and trigger auto-formatting and we wait on the reply to that to close Helix. #2059 has some more information on that. About debug logging, see: https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file

@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2022
@gregorywaynepower
Copy link

I also have this issue of "Error: Timed out waiting for language servers to shutdown" on Windows Terminal as well.

@neilyio
Copy link

neilyio commented Mar 2, 2023

+1 to this, it's made Helix unusable for me. Is there a workaround until the problem is fixed?

@Diorgeles
Copy link

+1 to this, it's made Helix unusable for me. Is there a workaround until the problem is fixed?

I override lsp config to bash and sh files, disable lsp
I copy all config in languages.toml example and paste in local language config, after I change how below print

Work for me

image

@wucke13
Copy link

wucke13 commented Jun 2, 2023

I use helix to format git commit messages, in 80% of the time my commit message is lost and git aborts the commit because the editor returns with a non-zero return code. I have ltex-ls as markdown LSP in language.name = "git-commit". How can I increase the timeout to at least not loose my commit messages time and time again?
/cc @sevenautumns

@sanatanhalder
Copy link

@wucke13 what is your ltex-ls status now? Have you got any solutions?

@wucke13
Copy link

wucke13 commented Jan 26, 2024

No solution so far

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

8 participants