When I edit typescript files with eglot active, it resets *indent-tabs-mode* and inserts tabs. I can toggle *indent-tabs-mode* to go back to spaces, but I'd like to leave it set the way I like. I'm trying to follow the instructions for *eglot-workspace-configuration* in the eglot manual, but it's not working.
I've tried creating a **.dir.local.el** file to set preferences for "typescript-language-server" (see below), but *eglot-show-workspace-configuration* shows nil, so I don't think these are being found.
The *kap/eglot-current-server* command I've written (see below) confirms that I'm running "(typescript-language-server --stdio)".
(use-package eglot
:hook
((js-ts-mode . eglot-ensure)
(tsx-ts-mode . eglot-ensure)
(typescript-ts-mode . eglot-ensure))
:custom
(eglot-stay-out-of indent-tabs-mode) ;; (This didn't work)
:bind
(:map eglot-mode-map))
(defun kap/eglot-current-server ()
(interactive)
(message "%s" (process-command (jsonrpc--process (eglot-current-server)))))
And **.dir.local.el** looks like this:
((nil
. ((eglot-workspace-configuration
. (:typescript-language-server (:typescript.format.convertTabsToSpaces nil)
(:javascript.format.convertTabsToSpaces nil))))))
The root problem is the insistence of eglot and/or the lsp server on tabs rather than spaces.
But the bigger issue I'd like is how to get configuration into the lsp server. Has anyone got **.dir.local.el** configuration to work for the "typescript-language-server"?