bash-language-server icon indicating copy to clipboard operation
bash-language-server copied to clipboard

Listen to TCP/Unix Socket for stdin/stdout

Open morph027 opened this issue 2 years ago • 3 comments

I'm using multiple vim instances in different terminals and all of them are spawning a new child process of bash-language-server qhich quite adds up on memory and battery life ;)

What do you think of the idea to create a tcp or unix listener for stdin/stdoud like https://github.com/python-lsp/python-lsp-server does? Therefore there's only one instance running and multiple editors can connect via socket.

morph027 avatar Aug 03 '22 17:08 morph027

I'm not sure how easy this would be to add, but contributions are more than welcome. It would probably be a good idea getting a prototype up and running that could reveal the challenges ahead.

skovhus avatar Nov 25 '22 11:11 skovhus

@morph027 I hope adding support for this should be fairly easy. We would just need to edit https://github.com/bash-lsp/bash-language-server/blob/main/server/src/cli.ts ... Especially now as we default to not including all workspace symbols, I don't foresee a lot of issues if multiple editors connects.

I suggest that we would add a flag to the CLI signalling that you want to use TCP/UNIX socket instead of stdin/stout.

Let me know if you want to help out implementing this.

skovhus avatar Jan 10 '23 21:01 skovhus

Jip, sounds good. I totally suck when writing js/ts but could take care of all the testing ;)

morph027 avatar Jan 11 '23 07:01 morph027