I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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-mode2 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

Download yasnippet3, used by a number of lsp-mode2 extensions to provide smart completion functionality.

(use-package yasnippet
  :ensure t)

UI integration

Download lsp-ui4 to provide user interface improvements for lsp-mode2 over the defaults.

(use-package lsp-ui
  :after lsp
  :custom (lsp-ui-doc-position 'at-point)
          (lsp-ui-doc-delay 0.500))

Code completion

Text completion provided by company5, AKA Complete Anything. Make sure it's integrated with lsp-mode2 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"))

Footnotes