bash-lsp/bash-language-server

Configuration and/or cache folders

krystalcode opened this issue · 4 comments

What is the problem this feature will solve?

Some language servers for other programming languages have folder, for example, for caching information about projects. I run language servers in containers but I want any configuration, cache or data folders to persist through volumes. From looking at bash-language-server documentation and code, it seems that there are a few environment variables that can be used for configuration, but there's no other relevant folders.

I just want to confirm that operating this language server is indeed stateless.

What is the feature you are proposing to solve the problem?

If my understanding is correct, nothing to do. Otherwise, improve documentation.

What alternatives have you considered?

No response

Hi, I've been using this language server for a while and have contributed some code. As far as I can tell, it is indeed stateless in that it doesn't store anything on disk.

On a side note, I'm sorry if this is such a tangent, I am interested in you running language servers in containers. I've tried it, but I get errors whenever my editor tries to connect to it. Do you have any materials or guides you can share about this?

Bash language server is stateless, so all good.

@mcecode

On a side note, I'm sorry if this is such a tangent, I am interested in you running language servers in containers. I've tried it, but I get errors whenever my editor tries to connect to it. Do you have any materials or guides you can share about this?

How exactly you can do this depends on your setup, such as which container orchestration program you use.

I run rootless containers with podman. I connect my text editor (Emacs) container to the same shared network with the language server. The language server starts listening to a port and the text editor LSP plugin needs to support making requests to a given host and port.

If you post more details about your setup maybe I can give you more specific guidance.

Thanks for the reply @krystalcode.

I also run rootless containers using Podman. The main difference between your setup and mine is that I have my code editor installed on my host machine rather than inside a container. As for the containers, I set the --network flag to host so that my editor can communicate with the language servers inside them. My editor is able to connect with the language servers, but an error always occurs when they try to start exchanging messages and the language servers end up crashing. Maybe it's a config or privilege error on my part.

I'd rather not hijack this issue any further with my tangent, so I think I'll try your approach of putting even the code editor inside a container a go. Hopefully, that'll work for me as is does for you.