Hacker News new | ask | show | jobs
by gnuvince 1049 days ago
Eglot is the built-in LSP client. You need an external server. If you do C or C++, clangd is likely what you want. Install it (apt install clangd) and enable eglot for C or C++ files in your Emacs config, (add-hook 'c-mode-hook 'eglot-ensure).
1 comments

And if you are in a legacy system with no clang then?

Emacs is usually batteries included, couldn't an lsp server have been part of the package..

That'd increase the package disk footprint by a large value since there are many languages supported by Emacs by default.
Then it would just have a dependency on Clang, and you couldn't use Emacs at all (since you can't use Clang).

AFAIK, the only alternative to the clangd language server is ccls: https://github.com/MaskRay/ccls