Skip to content

Core#

lsp-after-apply-edits-hook#

Type: hook

Default: nil

Hooks to run when text edit is applied. It contains the operation source.


lsp-after-diagnostics-hook#

Type: hook

Default: nil

Hooks to run after diagnostics are received.


lsp-after-initialize-hook#

Type: hook

Default: nil

List of functions to be called after a Language Server has been initialized for a new workspace.


lsp-after-open-hook#

Type: hook

Default: nil

List of functions to be called after a new file with LSP support is opened.


lsp-after-uninitialized-functions#

Type: hook

Default: nil

List of functions to be called after a Language Server has been uninitialized.


lsp-apply-edits-after-file-operations#

Type: boolean

Default: t

Whether to apply edits returned by server after file operations if any. Applicable only if server supports workspace.fileOperations for operations: workspace/willRenameFiles, workspace/willCreateFiles and workspace/willDeleteFiles.


lsp-auto-configure#

Type: boolean

Default: t

Auto configure lsp-mode main features. When set to t lsp-mode will auto-configure completion, code-actions, breadcrumb, flycheck, flymake, imenu, symbol highlighting, lenses, links, and so on.

For finer granularity you may use lsp-enable-* properties.


lsp-auto-execute-action#

Type: boolean

Default: t

Auto-execute single action.


lsp-auto-guess-root#

Type: boolean

Default: nil

Automatically guess the project root using projectile/project. Do not use this setting unless you are familiar with lsp-mode internals and you are sure that all of your projects are following projectile/project.el conventions.


lsp-auto-select-workspace#

Type: boolean

Default: t

Shutdown or restart a single workspace. If set and the current buffer has only a single workspace associated with it, lsp-shutdown-workspace and lsp-restart-workspace will act on it without asking.


lsp-auto-touch-files#

Type: boolean

Default: t

If non-nil ensure the files exist before sending textDocument/didOpen notification.


lsp-before-apply-edits-hook#

Type: hook

Default: nil

Hooks to run before applying edits.


lsp-before-initialize-hook#

Type: hook

Default: nil

List of functions to be called before a Language Server has been initialized for a new workspace.


lsp-before-open-hook#

Type: hook

Default: nil

List of functions to be called before a new file with LSP support is opened.


lsp-before-save-edits#

Type: boolean

Default: t

If non-nil, lsp-mode will apply edits suggested by the language server before saving a document.


lsp-client-packages#

Type: (repeat symbol)

Default: (ccls lsp-actionscript lsp-ada lsp-angular lsp-ansible lsp-bash lsp-beancount lsp-clangd lsp-clojure lsp-cmake lsp-crystal lsp-csharp lsp-css lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile lsp-elm lsp-elixir lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-go lsp-gleam lsp-graphql lsp-hack lsp-grammarly lsp-groovy lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript lsp-json lsp-kotlin lsp-latex lsp-ltex lsp-lua lsp-markdown lsp-marksman lsp-mint lsp-nginx lsp-nim lsp-nix lsp-magik lsp-metals lsp-mssql lsp-ocaml lsp-openscad lsp-pascal lsp-perl lsp-perlnavigator lsp-pls lsp-php lsp-pwsh lsp-pyls lsp-pylsp lsp-pyright lsp-python-ms lsp-purescript lsp-r lsp-racket lsp-remark lsp-rf lsp-rust lsp-solargraph lsp-sorbet lsp-sourcekit lsp-sonarlint lsp-tailwindcss lsp-tex lsp-terraform lsp-toml lsp-ttcn3 lsp-typeprof lsp-v lsp-vala lsp-verilog lsp-vetur lsp-volar lsp-vhdl lsp-vimscript lsp-xml lsp-yaml lsp-ruby-syntax-tree lsp-sqls lsp-svelte lsp-steep lsp-zig)

List of the clients to be automatically required.


lsp-completion-default-behaviour#

Type: (choice (const :insert :tag Default completion inserts) (const :replace :tag Default completion replaces))

Default: :replace

Default behaviour of InsertReplaceEdit.


lsp-configure-hook#

Type: hook

Default: ((closure (flymake-mode flymake-diagnostic-functions lsp-diagnostics-mode flycheck-checkers flycheck-checker flycheck-check-syntax-automatically flycheck-mode t) nil (if lsp-auto-configure (progn (lsp-diagnostics--enable)))) (closure (company-abort-on-unique-match company-backends yas-indent-line t) nil (if (and lsp-auto-configure lsp-completion-enable) (progn (lsp-completion--enable)))))

Hooks to run when lsp-configure-buffer is called.


lsp-debounce-full-sync-notifications#

Type: boolean

Default: t

If non-nil debounce full sync events. This flag affects only servers which do not support incremental updates.


lsp-debounce-full-sync-notifications-interval#

Type: float

Default: 1.0

Time to wait before sending full sync synchronization after buffer modification.


lsp-default-create-error-handler-fn#

Type: function

Default: nil

Default error handler customization. Handler should give METHOD as argument and return function of one argument ERROR.


lsp-details-face#

Type: face

Default: ((t :height 0.8 :inherit shadow))

Used to display additional information troughout lsp. Things like line numbers, signatures, ... are considered additional information. Often, additional faces are defined that inherit from this face by default, like lsp-signature-face, and they may be customized for finer control.


lsp-diagnostics-updated-hook#

Type: hook

Default: nil

Hooks to run after diagnostics are received.


lsp-disabled-clients#

Type: (repeat (symbol))

Default: nil

A list of disabled/blacklisted clients. Each entry in the list can be either: a symbol, the server-id for the LSP client, or a cons pair (MAJOR-MODE . CLIENTS), where MAJOR-MODE is the major-mode, and CLIENTS is either a client or a list of clients.

This option can also be used as a file- or directory-local variable to disable a language server for individual files or directories/projects respectively.


lsp-display-inline-image#

Type: boolean

Default: t

Showing inline image or not.


lsp-document-sync-method#

Type: (choice (const :tag Documents should not be synced at all. nil) (const :tag Documents are synced by always sending the full content of the document. lsp--sync-full) (const :tag Documents are synced by always sending incremental changes to the document. lsp--sync-incremental) (const :tag Use the method recommended by the language server. nil))

Default: nil

How to sync the document with the language server.


lsp-eldoc-enable-hover#

Type: boolean

Default: t

If non-nil, eldoc will display hover info when it is present.


lsp-eldoc-hook#

Type: hook

Default: (lsp-hover)

Hooks to run for eldoc.


lsp-eldoc-render-all#

Type: boolean

Default: nil

Display all of the info returned by document/onHover. If this is set to nil, eldoc will show only the symbol information.


lsp-enable-dap-auto-configure#

Type: boolean

Default: t

If non-nil, enable dap-auto-configure-mode.


lsp-enable-file-watchers#

Type: boolean

Default: t

If non-nil lsp-mode will watch the files in the workspace if the server has requested that.


lsp-enable-folding#

Type: boolean

Default: t

Enable/disable code folding support.


lsp-enable-imenu#

Type: boolean

Default: t

If non-nil, automatically enable imenu integration when server provides textDocument/documentSymbol.


lsp-enable-indentation#

Type: boolean

Default: t

Indent regions using the file formatting functionality provided by the language server.


Type: boolean

Default: t

If non-nil, all references to links in a file will be made clickable, if supported by the language server.


lsp-enable-on-type-formatting#

Type: boolean

Default: t

Enable textDocument/onTypeFormatting integration.


lsp-enable-suggest-server-download#

Type: boolean

Default: t

When non-nil enable server downloading suggestions.


lsp-enable-symbol-highlighting#

Type: boolean

Default: t

Highlight references of the symbol at point.


lsp-enable-text-document-color#

Type: boolean

Default: t

Enable textDocument/documentColor integration.


lsp-enable-xref#

Type: boolean

Default: t

Enable xref integration.


lsp-face-highlight-read#

Type: face

Default: ((t :inherit highlight :underline t))

Face used for highlighting symbols being read.


lsp-face-highlight-textual#

Type: face

Default: ((t :inherit highlight))

Face used for textual occurrences of symbols.


lsp-face-highlight-write#

Type: face

Default: ((t :inherit highlight :weight bold))

Face used for highlighting symbols being written to.


lsp-face-rename#

Type: face

Default: ((t :underline t))

Face used to highlight the identifier being renamed. Renaming can be done using lsp-rename.


lsp-file-watch-ignored-directories#

Type: (repeat string)

Default: ([/\\]\.git\' [/\\]\.github\' [/\\]\.circleci\' [/\\]\.hg\' [/\\]\.bzr\' [/\\]_darcs\' [/\\]\.svn\' [/\\]_FOSSIL_\' [/\\]\.idea\' [/\\]\.ensime_cache\' [/\\]\.eunit\' [/\\]node_modules [/\\]\.yarn\' [/\\]\.fslckout\' [/\\]\.tox\' [/\\]dist\' [/\\]dist-newstyle\' [/\\]\.stack-work\' [/\\]\.bloop\' [/\\]\.metals\' [/\\]target\' [/\\]\.ccls-cache\' [/\\]\.vscode\' [/\\]\.venv\' [/\\]\.mypy_cache\' [/\\]\.deps\' [/\\]build-aux\' [/\\]autom4te.cache\' [/\\]\.reference\' [/\\]\.lsp\' [/\\]\.clj-kondo\' [/\\]\.shadow-cljs\' [/\\]\.babel_cache\' [/\\]\.cpcache\' [/\\]\checkouts\' [/\\]\.m2\' [/\\]bin/Debug\' [/\\]obj\' [/\\]_opam\' [/\\]_build\' [/\\]\.elixir_ls\' [/\\]\.direnv\')

List of regexps matching directory paths which won`t be monitored when creating file watches. Customization of this variable is only honored at the global level or at a root of an lsp workspace.


lsp-file-watch-ignored-files#

Type: (repeat string)

Default: ([/\\]flycheck_[^/\\]+\' [/\\]\.#[^/\\]+\' [/\\][^/\\]+~\')

List of regexps matching files for which change events will not be sent to the server.

This setting has no impact on whether a file-watch is created for a directory; it merely prevents notifications pertaining to matched files from being sent to the server. To prevent a file-watch from being created for a directory, customize lsp-file-watch-ignored-directories

Customization of this variable is only honored at the global level or at a root of an lsp workspace.


lsp-file-watch-threshold#

Type: number

Default: 1000

Show warning if the files to watch are more than. Set to nil to disable the warning.


lsp-folding-line-folding-only#

Type: boolean

Default: nil

If non-nil, only fold complete lines.


lsp-folding-range-limit#

Type: (choice (const :tag No limit. nil) (integer :tag Number of lines.))

Default: nil

The maximum number of folding ranges to receive from the language server.


lsp-gunzip-script#

Type: string

Default: (closure (view-inhibit-help-message cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines company-minimum-prefix-length dap-ui-menu-items dap-auto-configure-mode yas-also-auto-indent-first-line yas-wrap-around-region yas-indent-line yas-inhibit-overlay-modification-protection t) nil (cond ((executable-find gzip) lsp-ext-gunzip-script) (t nil)))

The script to decompress a gzipped file. Should be a format string with one argument for the file to be decompressed in place.


lsp-idle-delay#

Type: number

Default: 0.5

Debounce interval for after-change-functions.


lsp-installation-buffer-face#

Type: face

Default: ((t :foreground green))

Face used for installation buffers still in progress. Used in lsp-select-installation-buffer.


lsp-installation-finished-buffer-face#

Type: face

Default: ((t :foreground orange))

Face used for finished installation buffers. Used in lsp-select-installation-buffer.


lsp-io-messages-max#

Type: (choice (const :tag Unlimited t) (integer :tag Messages))

Default: t

Maximum number of messages that can be locked in a lsp-io buffer.


lsp-keep-workspace-alive#

Type: boolean

Default: t

If non nil keep workspace alive when the last workspace buffer is closed.


lsp-keymap-prefix#

Type: string

Default: s-l

LSP-mode keymap prefix.


lsp-log-io#

Type: boolean

Default: nil

If non-nil, log all messages from the language server to a lsp-log buffer.


lsp-log-io-allowlist-methods#

Type: (repeat string)

Default: nil

The methods to filter before print to lsp-log-io.


lsp-log-max#

Type: (choice (const :tag Disable nil) (integer :tag lines) (const :tag Unlimited t))

Default: 1000

Maximum number of lines to keep in the log buffer. If nil, disable message logging. If t, log messages but don`t truncate the buffer when it becomes large.


lsp-on-change-hook#

Type: hook

Default: nil

Hooks to run when buffer has changed.


lsp-on-idle-hook#

Type: hook

Default: nil

Hooks to run after lsp-idle-delay.


lsp-overlay-document-color-char#

Type: string

Default:

Display the char represent the document color in overlay


lsp-progress-function#

Type: (choice (const :tag Use modeline lsp-on-progress-modeline) (const :tag Legacy(uses eitherprogress-reporter' or spinner' based onlsp-progress-via-spinner') lsp-on-progress-legacy) (const ignore :tag Ignore) (function :tag Other function))`

Default: lsp-on-progress-modeline

Function for handling the progress notifications.


lsp-progress-prefix#

Type: string

Default:

Progress prefix.


lsp-progress-spinner-type#

Type: (choice :tag Choose a spinner by name (const 3-line-clock) (const 2-line-clock) (const flipping-line) (const rotating-line) (const progress-bar) (const progress-bar-filled) (const vertical-breathing) (const vertical-rising) (const horizontal-breathing) (const horizontal-breathing-long) (const horizontal-moving) (const minibox) (const triangle) (const box-in-box) (const box-in-circle) (const half-circle) (const moon))

Default: progress-bar

Holds the type of spinner to be used in the mode-line. Takes a value accepted by spinner-start.


lsp-progress-via-spinner#

Type: boolean

Default: t

If non-nil, display LSP $/progress reports via a spinner in the modeline.


lsp-references-exclude-definition#

Type: boolean

Default: nil

If non-nil, exclude declarations when finding references.


lsp-rename-placeholder-face#

Type: face

Default: ((t :inherit font-lock-variable-name-face))

Face used to display the rename placeholder in. When calling lsp-rename interactively, this will be the face of the new name.


lsp-rename-use-prepare#

Type: boolean

Default: t

Whether lsp-rename should do a prepareRename first. For some language servers, textDocument/prepareRename might be too slow, in which case this variable may be set to nil. lsp-rename will then use thing-at-point symbol to determine the symbol to rename at point.


lsp-response-timeout#

Type: (choice (number :tag Seconds) (const :tag No timeout nil))

Default: 10

Number of seconds to wait for a response from the language server before timing out. Nil if no timeout.


lsp-restart#

Type: (choice (const interactive) (const auto-restart) (const ignore))

Default: interactive

Defines how server-exited events must be handled.


lsp-server-install-dir#

Type: directory

Default: ~/.emacs.d/.cache/lsp

Directory in which the servers will be installed.


lsp-server-trace#

Type: (choice (const :tag Disabled off) (const :tag Messages only messages) (const :tag Verbose verbose) (const :tag Default (disabled) nil))

Default: nil

Request tracing on the server side. The actual trace output at each level depends on the language server in use. Changes take effect only when a new session is started.


lsp-session-file#

Type: file

Default: ~/.emacs.d/.lsp-session-v1

File where session information is stored.


lsp-signature-auto-activate#

Type: (repeat (choice (const :tag On trigger chars pressed. :on-trigger-char) (const :tag After selected completion. :after-completion) (const :tag When the server has sent show signature help. :on-server-request)))

Default: (:on-trigger-char :on-server-request)

Auto activate signature conditions.


lsp-signature-cycle#

Type: boolean

Default: t

Whether lsp-signature-next and prev should cycle.


lsp-signature-doc-lines#

Type: number

Default: 20

If number, limit the number of lines to show in the docs.


lsp-signature-face#

Type: face

Default: ((t :inherit lsp-details-face))

Used to display signatures in imenu, ....


lsp-signature-function#

Type: function

Default: lsp-lv-message

The function used for displaying signature info. It will be called with one param - the signature info. When called with nil the signature info must be cleared.


lsp-signature-posframe#

Type: face

Default: ((t :inherit tooltip))

Background and foreground for lsp-signature-posframe.


lsp-signature-render-documentation#

Type: boolean

Default: t

Display signature documentation in eldoc.


lsp-symbol-highlighting-skip-current#

Type: boolean

Default: nil

If non-nil skip current symbol when setting symbol highlights.


lsp-symbol-kinds#

Type: (alist :key-type integer :value-type string)

Default: ((1 . File) (2 . Module) (3 . Namespace) (4 . Package) (5 . Class) (6 . Method) (7 . Property) (8 . Field) (9 . Constructor) (10 . Enum) (11 . Interface) (12 . Function) (13 . Variable) (14 . Constant) (15 . String) (16 . Number) (17 . Boolean) (18 . Array) (19 . Object) (20 . Key) (21 . Null) (22 . Enum Member) (23 . Struct) (24 . Event) (25 . Operator) (26 . Type Parameter))

Alist mapping SymbolKinds to human-readable strings. Various Symbol objects in the LSP protocol have an integral type, specifying what they are. This alist maps such type integrals to readable representations of them. See https://microsoft.github.io/language-server-protocol/specifications/specification-current/, namespace SymbolKind.


lsp-tar-script#

Type: string

Default: (closure (view-inhibit-help-message cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines company-minimum-prefix-length dap-ui-menu-items dap-auto-configure-mode yas-also-auto-indent-first-line yas-wrap-around-region yas-indent-line yas-inhibit-overlay-modification-protection t) nil (cond ((executable-find tar) lsp-ext-tar-script) (t nil)))

The script to decompress a .tar.gz file. Should be a format string with one argument for the file to be decompressed in place.


lsp-tcp-connection-timeout#

Type: number

Default: 2

The timeout for tcp connection in seconds.


lsp-unconfigure-hook#

Type: hook

Default: nil

Hooks to run when lsp-unconfig-buffer is called.


lsp-unzip-script#

Type: string

Default: (closure (view-inhibit-help-message cl-struct-lsp--log-entry-tags cl-struct-lsp-session-tags cl-struct-lsp--workspace-tags cl-struct-lsp--registered-capability-tags lsp-mode-menu cl-struct-lsp--folding-range-tags cl-struct-lsp-watch-tags cl-struct-lsp--client-tags lsp--log-lines company-minimum-prefix-length dap-ui-menu-items dap-auto-configure-mode yas-also-auto-indent-first-line yas-wrap-around-region yas-indent-line yas-inhibit-overlay-modification-protection t) nil (cond ((executable-find powershell) lsp-ext-pwsh-script) ((executable-find unzip) lsp-ext-unzip-script) (t nil)))

The script to unzip.


lsp-verify-signature#

Type: boolean

Default: t

Whether to check GPG signatures of downloaded files.


lsp-vscode-ext-url#

Type: string

Default: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/%s/vsextensions/%s/%s/vspackage%s

Vscode extension template url.


lsp-warn-no-matched-clients#

Type: boolean

Default: t

Whether to show messages when there are no supported clients.


lsp-workspace-folders-changed-functions#

Type: hook

Default: nil

Hooks to run after the folders has changed. The hook will receive two parameters list of added and removed folders.



Last update: October 5, 2022