Enable inlay hints for typescript.
This commit is contained in:
parent
724a8ca394
commit
1024f37691
@ -23,6 +23,52 @@
|
||||
(run-command-on-buffer "jq" "--monochrome-output" ".")
|
||||
)
|
||||
|
||||
(defun configure-typescript-language-server ()
|
||||
"Configures the typescript language server."
|
||||
(when-linux
|
||||
;; Either initializationOptions or workspace/didChangeConfiguration works.
|
||||
(setq eglot-workspace-configuration
|
||||
(list (cons ':typescript '(:inlayHints (:includeInlayParameterNameHints
|
||||
"all"
|
||||
:includeInlayParameterNameHintsWhenArgumentMatchesName
|
||||
t
|
||||
:includeInlayFunctionParameterTypeHints
|
||||
t
|
||||
:includeInlayVariableTypeHints
|
||||
t
|
||||
:includeInlayVariableTypeHintsWhenTypeMatchesName
|
||||
t
|
||||
:includeInlayPRopertyDeclarationTypeHints
|
||||
t
|
||||
:includeInlayFunctionLikeReturnTypeHints
|
||||
t
|
||||
:includeInlayEnumMemberValueHints
|
||||
t)))))
|
||||
(eglot-ensure)
|
||||
;; (defclass my/eglot-typescript (eglot-lsp-server) ()
|
||||
;; :documentation
|
||||
;; "Own eglot server class.")
|
||||
|
||||
;; (add-to-list 'eglot-server-programs
|
||||
;; '((js-mode js-ts-mode tsx-ts-mode typescript-ts-mode typescript-mode) . (my/eglot-typescript "typescript-language-server" "--stdio" :initializationOptions (:preferences (:includeInlayParameterNameHints
|
||||
;; "all"
|
||||
;; :includeInlayParameterNameHintsWhenArgumentMatchesName
|
||||
;; t
|
||||
;; :includeInlayFunctionParameterTypeHints
|
||||
;; t
|
||||
;; :includeInlayVariableTypeHints
|
||||
;; t
|
||||
;; :includeInlayVariableTypeHintsWhenTypeMatchesName
|
||||
;; t
|
||||
;; :includeInlayPRopertyDeclarationTypeHints
|
||||
;; t
|
||||
;; :includeInlayFunctionLikeReturnTypeHints
|
||||
;; t
|
||||
;; :includeInlayEnumMemberValueHints
|
||||
;; t)))))
|
||||
)
|
||||
)
|
||||
|
||||
(use-package tsx-ts-mode
|
||||
:ensure nil
|
||||
:pin manual
|
||||
@ -33,7 +79,7 @@
|
||||
:hook (
|
||||
(tsx-ts-mode . (lambda ()
|
||||
(when-linux
|
||||
(eglot-ensure)
|
||||
(configure-typescript-language-server)
|
||||
)
|
||||
))
|
||||
)
|
||||
@ -52,9 +98,7 @@
|
||||
:commands (typescript-ts-mode)
|
||||
:hook (
|
||||
(typescript-ts-mode . (lambda ()
|
||||
(when-linux
|
||||
(eglot-ensure)
|
||||
)
|
||||
(configure-typescript-language-server)
|
||||
))
|
||||
)
|
||||
:init
|
||||
|
Loading…
x
Reference in New Issue
Block a user