Skip to content

Commit

Permalink
Feature/ts-ls init opts (#3141)
Browse files Browse the repository at this point in the history
* Allow for configuration of typescript-language-server initialization preferences

* cleanup

* PR feedback: add url to definition of available options
  • Loading branch information
orzechowskid authored Oct 6, 2021
1 parent 23e015c commit 2373639
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion clients/lsp-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
:group 'lsp-typescript
:type 'string)

(defcustom lsp-clients-typescript-init-opts nil
"Configuration options provided to tsserver.
See the UserPreferences interface at https://github.com/microsoft/TypeScript/blob/main/lib/protocol.d.ts for the list of options available in the latest version of TypeScript."
:group 'lsp-typescript
:type 'plist)

(defcustom lsp-clients-typescript-plugins (vector)
"The list of plugins to load.
It should be a vector of plist with keys `:location' and `:name'
Expand Down Expand Up @@ -138,7 +144,8 @@ directory containing the package. Example:
:initialization-options (lambda ()
(list :plugins lsp-clients-typescript-plugins
:logVerbosity lsp-clients-typescript-log-verbosity
:tsServerPath (lsp-package-path 'typescript)))
:tsServerPath (lsp-package-path 'typescript)
:preferences lsp-clients-typescript-init-opts))
:ignore-messages '("readFile .*? requested by TypeScript but content not available")
:server-id 'ts-ls
:request-handlers (ht ("_typescript.rename" #'lsp-javascript--rename))
Expand Down

0 comments on commit 2373639

Please sign in to comment.