doomemacs/modules/tools/lsp/autoload/common.el
Henrik Lissner c06040338a
fix(lsp,tree-sitter): void-function lsp!/tree-sitter! errors
These are autodefs, meaning they should be defined whether or not the
containing module is enabled, but they should no-op when it's disabled,
by defining a no-op macro with the same name. However, lsp! and
tree-sitter! are meant to be used as hooks, and you can't use macros as
hooks, so you get void-function errors when they are used as such.

This ensures they are properly defined as no-op functions in those
cases. I.e.

  ;;;###autodef FORM

FORM is used instead of a no-op macro if the parent module is disabled.
2022-06-22 20:35:52 +02:00

10 lines
301 B
EmacsLisp

;;; tools/lsp/autoload/common.el -*- lexical-binding: t; -*-
;;;###autodef (fset 'lsp! #'ignore)
(defun lsp! ()
"Dispatch to call the currently used lsp client entrypoint"
(interactive)
(if (featurep! +eglot)
(eglot-ensure)
(unless (bound-and-true-p lsp-mode)
(lsp-deferred))))