serve-d and emacs

Per Nordlöw per.nordlow at gmail.com
Wed Apr 19 11:19:57 UTC 2023


On Wednesday, 19 April 2023 at 10:35:31 UTC, Per Nordlöw wrote:
> On Wednesday, 19 April 2023 at 09:39:19 UTC, Per Nordlöw wrote:
>> On Wednesday, 19 April 2023 at 09:37:56 UTC, Per Nordlöw wrote:
>>> . Has anybody gotten these things to work?
>>
>> I'm gonna try `lsp-mode` instead of `eglot`.
>
> I believe this should work
>
> ```elisp
> (defun serve-d-command ()
>   "Shell command to start serve-d."
>   '("dub" "run" "--vquiet" "serve-d"))
>
> (when (require 'lsp nil t)
>   (dolist (mode '(d-mode d-ts-mode))
> 	(add-hook mode #'lsp)
> 	(add-to-list 'lsp-language-id-configuration `(,mode . "d")))
>   (lsp-register-client
>    (make-lsp-client
>     :new-connection (lsp-stdio-connection #'serve-d-command)
>     :major-modes '(d-mode d-ts-mode)
>     :server-id 'serve-d)))
> ```
>
> but unfortunately I get status disconncted in the mode-line and 
> the call to dub run shuts down. Clues anyone?

Hmm, it turns out that using this a call to lsp-mode with this 
never triggers a call to the elisp function `serve-d-command`

. I don't see what's wrong.


More information about the Digitalmars-d-learn mailing list