You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if I'm doing it wrong or if there's a bug in either nil or Emacs eglot, so I'm hoping you can help me. I'm trying to switch from lsp-mode to eglot with Emacs 29 and I can't seem to get initialization-time formatter configuration to work. I expect that calling eglot-format-buffer should work regardless of whether the formatter is configured during initialization or at run-time, but only the latter does anything.
caleb@desktop> nil --version
nil 2023-08-09
caleb@desktop> emacs --version
GNU Emacs 29.1
Copyright (C) 2023 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
caleb@desktop> uname -a
Linux desktop 6.4.11 #1-NixOS SMP PREEMPT_DYNAMIC Wed Aug 16 16:32:31 UTC 2023 x86_64 GNU/Linux
I notice there's a workspace/didChangeConfiguration message here, even though I'm not telling eglot to do that since eglot-workspace-configuration is nil, but I think(:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data ()))) represents an empty table?
I'm not familiar with emacs but the log seems weird since it sends initializationOptions but responding [nil] for workspace/configuration requests. I tried to use initializationOptions with workspace/configuration disabled under nvim and it seems to work fine.
Could you set env var NIL_LOG to be nil=debug and provide the stderr of the server? If it's hard to retrieve the server's stderr, NIL_LOG_PATH can also be set to a file path to write the log into.
I have this working with the following config. looks like, when you set initializationOptions for a language server, the options are nested under the name of the language server already. so, having your options under (:nil) is actually incorrect.
Overview
I'm not sure if I'm doing it wrong or if there's a bug in either nil or Emacs eglot, so I'm hoping you can help me. I'm trying to switch from lsp-mode to eglot with Emacs 29 and I can't seem to get initialization-time formatter configuration to work. I expect that calling
eglot-format-buffer
should work regardless of whether the formatter is configured during initialization or at run-time, but only the latter does anything.For reference, here's an online version of eglot's info page: https://joaotavora.github.io/eglot/#User_002dspecific-configuration
Version info:
Broken: initializationOptions
Config:
LSP messages shown after loading a nix file and running
eglot-format-buffer
:I notice there's a
workspace/didChangeConfiguration
message here, even though I'm not telling eglot to do that sinceeglot-workspace-configuration
is nil, but I think(:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data ())))
represents an empty table?Working: post-initialization settings
If I use this config instead, formatting works:
Messages:
The text was updated successfully, but these errors were encountered: