bash-lsp / bash-language-server

A language server for Bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starts but then soon quits after exchanging a few messages

goldfita opened this issue · comments

Code editor

Emacs

Platform

Windows 10

Version

5.0.0 (node v21.1.0)

What steps will reproduce the bug?

I'm starting the server in a powershell script called from a small python program that communicates with Emacs. I have this working with two Java based language servers. The Java language servers use a framework that has a parent process watcher, which I needed to disable. Is there a similar such thing in bash-language-server?

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

Always.

What is the expected behavior?

It shouldn't quit.

What do you see instead?

In the following '++' is a write to stdout from bash-language-server and '--' is a read. I'm only showing the part where it quits. It breaks the output stream and quits at 'end write'.

++ {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":2,"message":"16:37:39.655 WARNING ⛔️ ShellCheck: disabling linting as no executable was found at path 'shellcheck'"}}Content-Length: 146

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///C%3A/Development/test/blah.sh","version":0,"diagnostics":[]}}
-- Content-Length: 243

{"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C%3A/Development/test/blah.sh"},"range":{"start":{"line":19,"character":25},"end":{"line":19,"character":25}},"context":{"diagnostics":[]}},"id":149}

++ Content-Length: 134

++ {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"16:37:39.698 DEBUG onCodeAction: found 0 code action(s)"}}Content-Length: 38

{"jsonrpc":"2.0","id":149,"result":[]}
++
end write
-- Content-Length: 243

{"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///C%3A/Development/test/blah.sh"},"range":{"start":{"line":19,"character":25},"end":{"line":19,"character":25}},"context":{"diagnostics":[]}},"id":150}

-- Content-Length: 181

Additional information

I somewhat familiar with JavaScript. If it's not immediate what the problem is, I might be able to dig in if you point me in the right direction.

Bash-language-server appears to be using the following dependency linked below. Is there a command line option to disable the watchdog?

typescript-language-server/typescript-language-server#262

https://github.com/microsoft/vscode-languageserver-node/blob/d58c00bbf8837b9fd0144924db5e7b1c543d839e/server/src/node/main.ts#L79-L93

I got this to work by adding --clientProcessId=0.