1

The yarn package manager suggests a snippet of elisp to use:

Create a .dir-locals.el with the following content to enable Flycheck and LSP support and make sure LSP is loaded after local variables are applied to trigger the eval-after-load:

((typescript-mode . ((eval . (let ((project-directory (car (dir-locals-find-file default-directory)))) (setq lsp-clients-typescript-server-args `("--tsserver-path" ,(concat project-directory ".yarn/sdks/typescript/bin/tsserver") "--stdio"))))))) 

When I create the .dir-locals.el file and open it I see the following warning:

‘(typescript-mode (eval let ((project-directory (car (dir-locals-find-file default-directory)))) (setq lsp-clients-typescript-server-args `("--tsserver-path" ,(concat project-directory ".yarn/sdks/typescript/bin/tsserver") "--stdio"))))’ is a malformed function 

Is this a malformed function?

If so then in what way is it malformed?

Major modes:

Emacs-Lisp, ElDoc 

Enabled minor modes:

Auto-Composition Auto-Compression Auto-Encryption Company Counsel-Projectile Delete-Selection Diff-Hl Diff-Hl-Flydiff Drag-Stuff Drag-Stuff-Global Editorconfig Electric-Indent File-Name-Shadow Flycheck Font-Lock Global-Auto-Revert Global-Company Global-Diff-Hl Global-Eldoc Global-Font-Lock Global-Git-Commit Global-Hl-Line Global-Page-Break-Lines Global-Undo-Tree Ivy Key-Chord Line-Number Linum Magit-Auto-Revert Mouse-Wheel Page-Break-Lines Projectile Shell-Dirtrack Show-Paren Smartparens Smartparens-Global Tooltip Transient-Mark Undo-Tree Volatile-Highlights Which-Key Yas Yas-Global 
3
  • emacs.stackexchange.com/tags/elisp/info Commented Oct 3, 2021 at 11:06
  • It is not a function at all, but when you look at this in a buffer, you should not get any warning: it's just text (unless you are running something like flycheck or similar). If you try to evaluate this, then you should get an "illegal function" error, since you are trying to call something which is not a function. What's the buffer that contains this code when you look at it and what major/minor modes are enabled on it? Do C-h m to find out and edit your question with the additional information. Commented Oct 3, 2021 at 11:12
  • Thanks Nick. Yes, I'm running flycheck. Commented Oct 3, 2021 at 11:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.