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

Starts but then soon quits after exchanging a few messages #1036

Open
goldfita opened this issue Nov 13, 2023 · 2 comments
Open

Starts but then soon quits after exchanging a few messages #1036

goldfita opened this issue Nov 13, 2023 · 2 comments

Comments

@goldfita
Copy link

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.

@goldfita
Copy link
Author

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

@goldfita
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant