Replies: 3 comments
-
I'd try Then after you're happy and verify the server works, you modify the Elisp variable Thereafter a simple If this answer is too terse, let's hope someone else chimes in, I don't have time to expand on it. |
Beta Was this translation helpful? Give feedback.
-
You can use add-node-modules-path. It will automatically add |
Beta Was this translation helpful? Give feedback.
-
@noghartt my understanding is that, confusingly, typescript-language-server, which is not an official TypeScript project but does wrap Also, following @zhaozhemin's advice to use add-node-modules-path should work so that Here is an extract of my configuration that assumes you:
(use-package eglot
:defer t)
(use-package add-node-modules-path
:defer t
:commands
(add-node-modules-path)
:load-path "lisp/")
(use-package typescript-ts-mode
:defer t
:mode
("\\.ts\\'" . typescript-ts-mode) ; from `typescript-ts-mode.el`
("\\.tsx\\'" . tsx-ts-mode) ; from `typescript-ts-mode.el`
:config
(progn
(defun kl/ts-ts-mode-hook ()
(add-node-modules-path)
(eglot-ensure))
(add-hook 'typescript-ts-mode-hook #'kl/ts-ts-mode-hook)
(add-hook 'tsx-ts-mode-hook #'kl/ts-ts-mode-hook))) You may need to tweak things to get it working for your set up. Good luck! |
Beta Was this translation helpful? Give feedback.
-
I'm a beginner with Emacs and I just try to use
eglot
as my LSP client. Following this setup I can runeglot
, but I have a doubt now:Is there a way to put eglot to run with
tsserver
fromnode_modules
of my project instead ofPATH
? Because exists atsserver
onnode_modules/.bin
and I would like to use it.Beta Was this translation helpful? Give feedback.
All reactions