Jump to content

Topic on User talk:ArielGlenn/Emacs as a PHP IDE

MarkAHershberger (talkcontribs)

So, just a status update: I know flycheck can use multiple "providers", since I've used it to get psalm + codesniffer input at the same time.

lsp-mode does not appear to be able to work with multiple language servers, but I'd really like to be able to use it as a provider for M-.

This means (to me) that I need to get flycheck+lsp working together, which seems to be the intended possibility.

But right now, I'm seeing Error (use-package): lsp-ui/:config: :start lsp-diagnostics--flycheck-start of syntax checker lsp is not a functionand my use-package stanza for lsp-ui looks like this:

(use-package lsp-ui
  :requires flycheck
  :after lsp-mode
  :config
  (flycheck-define-generic-checker 'lsp
    "A syntax checker using the Language Server Protocol (LSP)
provided by lsp-mode.
See https://github.com/emacs-lsp/lsp-mode."
    :start #'lsp-diagnostics--flycheck-start
    :modes '(lsp-placeholder-mode) ;; placeholder
    :predicate (lambda () lsp-mode)
    :error-explainer (lambda (e)
                       (cond ((string-prefix-p "clang-tidy" (flycheck-error-message e))
                              (lsp-cpp-flycheck-clang-tidy-error-explainer e))
                             (t (flycheck-error-message e)))))
;;  (lsp-flycheck-add-mode 'php-mode)

  (setq
   lsp-ui-doc-enable t
;;   lsp-ui-doc-include-signature t

   lsp-ui-flycheck-list-position 'bottom

   lsp-ui-imenu-enable t

   lsp-ui-peek-enable t
   lsp-ui-peek-list-width 60
   lsp-ui-peek-peek-height 25

   lsp-ui-sideline-enable t
   lsp-ui-sideline-update-mode 'line
   lsp-ui-sideline-show-code-actions t
   lsp-ui-sideline-show-hover nil)

  :bind
  (:map lsp-ui-mode-map
	  ("C-c C-j" . lsp-ui-peek-find-definitions)
	  ("C-c i"   . lsp-ui-peek-find-implementation)
	  ("C-c m"   . lsp-ui-imenu))

  :hook
  (lsp-mode . lsp-ui-mode))

Reply to "flycheck + lsp"