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

[Enhancement] Automatic client detection #512

Closed
seagle0128 opened this issue Dec 6, 2018 · 9 comments · Fixed by #544
Closed

[Enhancement] Automatic client detection #512

seagle0128 opened this issue Dec 6, 2018 · 9 comments · Fixed by #544
Assignees

Comments

@seagle0128
Copy link
Collaborator

Hi, I am using new interface lsp. Is it any possible to add automatic client detection for lsp-clients? Like eglot, then only one config to setup.

(add-hook 'prog-mode-hook 'lsp)

Users don't need to care about lsp client should be used in which mode. lsp knows which client should be started in current programming mode. That's more intelligent.

@yyoncho
Copy link
Member

yyoncho commented Dec 6, 2018

I was aiming to this functionality but I am seeing #506 as a prerequisite. Since we ship with predefined set of configuration, how do you think that we should handle the case when the serve is not present?

@seagle0128
Copy link
Collaborator Author

seagle0128 commented Dec 7, 2018

I don't think #506 is the prerequisite.

If the binaries or packages are installed correctly, the lsp servers supported by lsp-mode will be started correctly as well. That's expected. The users should ensure the lsp servers they wanted are installed correctly by themselves. Otherwise, a prompt or message will be displayed.

Looking into eglot, and it doesn't require installing lsp servers before eglot-ensure.
So, if the server is not present or not supported, just needs one message to users, nothing else. If introducing system-package here, will make the things complicated. Just keep it simple and clean.

@innerout
Copy link
Contributor

innerout commented Dec 7, 2018

If you had a specific path given from the user or specified from lsp-mode wouldn't that be convenient?

@yyoncho
Copy link
Member

yyoncho commented Dec 7, 2018

@seagle0128 some of the servers does are started like java -jar ..., php args... so there is no predefined way to check whether the server is present so we will need one more property in server definition like :server-installed? .

@innerout can you explain a bit more what do you mean?

@innerout
Copy link
Contributor

innerout commented Dec 7, 2018

If you set a predefined path about the servers to be installed that could simplify the setup. Also support for all platforms will be easier to debug and configure as you will be able to take OS specific decisions if problems arise.

@seagle0128
Copy link
Collaborator Author

Maybe need connection test feature? Not sure how is it implemented in eglot. I think we can refer to it.

@yyoncho
Copy link
Member

yyoncho commented Dec 9, 2018

@seagle0128 I have made some adjustments in lsp.el (particulary not using user-error if there is no client handling a particular mode). The next step is to make lsp.el ignore the server if it is not present.

@yyoncho
Copy link
Member

yyoncho commented Dec 14, 2018

@seagle0128 #544 is proposed fix for the issue. It enables the (add-hook 'prog-mode-hook 'lsp) config.

@seagle0128
Copy link
Collaborator Author

seagle0128 commented Dec 16, 2018

@yyoncho Thanks for update. Waiting for merge.

@yyoncho yyoncho self-assigned this Dec 16, 2018
seagle0128 added a commit to seagle0128/.emacs.d that referenced this issue Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants