Error setting variable lsp-intelephense-stubs

What happened?

I’m using LSP intelephense server and I’m trying to customize the lsp-intelephense-stubs in my config.el

(after! lsp-mode
  (...)

  (setq lsp-intelephense-stubs (vconcat lsp-intelephense-stubs ["imagick"]))

  (...)

But I get an error initializing lsp-mode.

If I, later, eval that code it works fine and does what’s supposed to do.

What did you expect to happen?

Expect the variable to be correctly set.

Steps to reproduce

  1. Add above snippet to config.el
  2. Start LSP server

System information


Loading data dump...

Please produce a backtrace from the error.

Nevermind my last message. I can guess: lsp-intelephense-stubs isn’t defined until lsp-php is loaded (because that’s where it’s defined), so putting that setq inside (after! lsp-mode ...) is too early to reference it. Therefore:

;;; in $DOOMDIR/config.el
(after! lsp-php
  (setq lsp-intelephense-stubs (vconcat lsp-intelephense-stubs ["imagick"])))

However, never time, please include the error message (and a backtrace) when reporting errors.

Worked perfectly!

Thanks for your help and for Doom!