biviosoftware / home-env

MIT License
2 stars 2 forks source link

lsp-mode doesn't work in docker exec #76

Closed robnagler closed 9 months ago

robnagler commented 1 year ago

Get's prompted for something.

e-carlin commented 1 year ago

Can you give me steps to reproduce? I started a docker container, exec'd in, started emacs, started lsp-mode, and was able to use lsp-jump-to-definition.

robnagler commented 1 year ago

Unable to find installed server supporting this file. The following servers could be installed automatically:

e-carlin commented 1 year ago

Copied from our other thread:

That's normal. lsp-mode needs a language server to be installed. If you hit tab it will give you options. For python I use pyright. For js/ts I use ts-ls I searched some time ago for a way to hardcode this but didn't find a good option

Should I find a way to hardcode or call it good?

robnagler commented 1 year ago

I think lsp-mode should be off by default. You can turn it on with a pre-bivio-init.el. One option is to install it in Docker images by default if it is not already there, and have it turn off lsp-mode with the default being on if you don't explicitly turn it off (normal users).

e-carlin commented 1 year ago

One option is to install it in Docker images by default

Install the language server or pre-bivio-init.el?

should be off by default ... default being on

Should lsp-mode be off or on by default?

robnagler commented 1 year ago

Install the language server or pre-bivio-init.el?

I meant pre-bivio-init.el

Should lsp-mode be off or on by default?

A design decision. I think the net effect for exec'ing into a docker container should be no prompt or lsp compiles. Usually this happens when something is already strange going in sysadmin on prod, and this just adds to the confusion (at least for me).

As to how to accomplish this, I made two suggestions. I'm not sure which one is best.

e-carlin commented 1 year ago

We ran into this again today. Here is what I'm going to try to implement:

@robnagler @moellep if the pre-requisites aren't met so the language servers can't be installed what would you like me to do? One option would be to disable lsp-mode and print a message somewhere (mini-bufer? *Messages*?).

robnagler commented 1 year ago

Thanks, and sounds good.

If it is off by default, then let the error just percolate. The user has to be explicit to turn it on so they should follow the complete install instructions (wherever those are).

e-carlin commented 1 year ago

I read about eglot yesterday https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/EGLOT-NEWS?h=emacs-29 . It is a standalone LSP package that was merged into emacs. I'm going to investigate it and if it works then switch to it and implement the above plan.

e-carlin commented 9 months ago

Made obsolete by https://github.com/biviosoftware/home-env/issues/110