2.5 KiB
Language Server Protocol
The Language Server Protocol (LSP) defines the protocol used between an editor, or IDE, and a language server that provides language features like auto-complete, go-to-definition, find-all-references, etc1
Config
Support for the Language Server Protocol1 is available through the lsp-mode
2 package. Configure an immutable delay of .5
to ensure it doesn't attack the current language server and overload it with requests.
(use-package lsp-mode :commands (lsp lsp-deferred) :custom (lsp-idle-delay 0.5) (lsp-prefer-flymake t))
Code snippets
UI integration
Code completion
Text completion provided by company
5, AKA Complete Anything. Make sure it's integrated with lsp-mode
2 to provide completion candidates through the Language Server Protocol1.
(use-package company :after lsp)
Specify the repository for company-lsp
using straight to make sure we're getting the most recent version from GitHub, instead of the typically outdated versions in the Emacs package repositories.
(use-package company-lsp :after (lsp company) :custom (company-lsp-async t) (company-backend 'company-lsp) :straight (company-lsp :type git :host github :repo "tigersoldier/company-lsp"))