bash-lsp / bash-language-server

A language server for Bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LSP Hanging on Close, Freezing after a few seconds and then suddenly drawing a lot of system resources.

sweetbbak opened this issue · comments

Code editor

Helix, Neovim

Platform

Unix

Version

5.0.0

What steps will reproduce the bug?

Opening my editor (Helix in this case) the LSP will start, it will make the usual corrections and suggestions... but then it will freeze within a few seconds, become unresponsive and start to eat up a ton of CPU power. It starts to sound like my PC is a helicopter attempting to takeoff. Then closing the editor, the editor will hang and throw an error that says "The LSP is unresponsive / did not close correctly"

How often does it reproduce? Is there a required condition?

Every single time I use bash-language-server and open a shell script. Disabling bash-language-server is the only thing that fixes the issue.

What is the expected behavior?

No response

What do you see instead?

LSP immediately freezing
Hanging on Close
Increased CPU usage by quite a lot

Additional information

No response

bash-language-server has been completely unusable. It continues to use extremely high CPU and hang indefinitely on close.

Temporary solution is downgrading to version 4.10.2-1

Holy fuck! Seems I fixed it. I deleted bashIde.globPattern ext. setting at all for all locatiions (User, Remote ..).
It was default value: **/*@(.sh|.inc|.bash|.command)
Now it is empty "bashIde.globPattern": ""

image

No CPU eating now. It seems a bug.

I even don't know the purpose of bashIde.globPattern. The extension still working as previous.

its using globbing to find files with those extensions so it can find/parse functions and variables in other files. **/* is recursive globbing and @(.x|.y|.z) is a capture group for things that end with those extensions. That could certainly take a lot of CPU, especially with a lot of sub-directories.

I'm not 100% sure if that came from bash-language-server (or vscode/another extension), but its good to know in-case anyone wants to bisect this issue across the last few versions.

I think it is a bug, because my Workspace contains only 10 small shell files.