Skip to content

Commit

Permalink
lsp-javascript: supply correct path to tsserver for ts-ls (#4202)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiennq authored Oct 26, 2023
1 parent 413d65a commit 808c4d0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions clients/lsp-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,11 @@ name (e.g. `data' variable passed as `data' parameter)."
(f-exists? (lsp-clients-typescript-project-ts-server-path)))
(lsp-clients-typescript-project-ts-server-path))
(t
(lsp-package-path 'typescript))))
(f-join (f-parent (lsp-package-path 'typescript)) "node_modules" "typescript" "lib"))))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection (lambda ()
`(,(lsp-package-path 'typescript-language-server)
"--tsserver-path"
,(lsp-clients-typescript-server-path)
,@lsp-clients-typescript-server-args)))
:activation-fn 'lsp-typescript-javascript-tsx-jsx-activate-p
:priority -2
Expand All @@ -825,8 +823,8 @@ name (e.g. `data' variable passed as `data' parameter)."
(list :plugins lsp-clients-typescript-plugins))
(when lsp-clients-typescript-preferences
(list :preferences lsp-clients-typescript-preferences))
(when lsp-clients-typescript-tsserver
(list :tsserver lsp-clients-typescript-tsserver))))
`(:tsserver ( :path ,(lsp-clients-typescript-server-path)
,@lsp-clients-typescript-tsserver))))
:initialized-fn (lambda (workspace)
(with-lsp-workspace workspace
(lsp--set-configuration
Expand Down

0 comments on commit 808c4d0

Please sign in to comment.