Closed rye closed 4 years ago
I'm not the right person to ask, getting notifications about this kinda just makes me sad
Every time I use a new language I feel like I spend 3 hours trying to decide which language server I want to use etc. IMHO we should just leave it up to the user's config. I don't think there's a way to save a substantial amount of time with the proposed changes.
@samontea, that makes sense to me. I hadn't thought much about different language servers for the same language.
I will note that, at least on the langserver.org table, it looks like a lot of languages only have one or two language server implementations to choose from, but these are things that the user might want to configure.
Would it be safe to just add lsp-mode
(also, lsp-ui
?) to the dependencies, and the relevant line in the .gitignore
for changes? This way, the dependencies would be installed for everyone, but not turned on.
I'm not sure about lsp-ui
vs company-lsp
, so maybe leaving that out and letting users decide would be better.
So since this PR literally just contains the addition of lsp-mode
as a dependency and one new line to the .gitignore
, could we merge it? Should we?
This PR adds
lsp-mode
(https://github.com/emacs-lsp/lsp-mode) to the project, and demonstrates adding support for LSP in a specific language.lsp-mode
is a big project but seems like a very solid companion for this project. In particular:How do they do it? A "language server" is implemented for each language, and the "language server protocol" (JSON+RPC-based) is implemented by these servers, allowing for tasks common to all languages (code completion, hover things, jump-to-def, workspacing, and diagnostics) to be implemented once by those who know the language well.
This means that rather than write bindings for each editor for each language, (with M editors and N languages, that's M*N implementations) instead one ostensibly only needs to write one language server for each language and one client for each editor, reducing the number of implementations to M+N.
In reality, it's a bit closer to M*N+kN, where k is a small constant, as there is a bit of variability in how language servers are implemented, found, and selected between languages, but this is all just wiring effort and thus much easier to support in the long-run.
Some questions before I open this for merging:
lsp-mode
forprog-mode-hook
instead of just selectively enabling for certain languages? In this way,lsp-mode
becomes the bottleneck for support, and we don't have to maintain any code. LSPs are also only used when they are found.flymake
vscompany-*
? It's been a while since I've taken a look at the differences in opinion about those. We could leave those up to the user and just use the defaults thatlsp-mode
selects, if that's an okay compromise.