Doom Emacs,如何配置Eglot使用Omnisharp

已知:本地解压安装好Omnisharp,Emacs版本29,Windows环境,使用Doom Emacs,(lsp +eglot)选项开启,(csharp +dotnet +lsp)选项开启

既有操作: 在package.el 文件添加如下配置:

(use-package! eglot
  :config
  (add-to-list 'eglot-server-programs
               '(csharp-mode . ("E:/omnisharp/OmniSharp.exe" "-lsp"))))

在执行 doom sync 命令后出现如下报错:

x There was an unexpected runtime error
    Message: Symbol's function definition is void
    Details: (use-package!)
    Backtrace:
      (use-package! eglot :config (if (member '(csharp-mode "E:/omnisharp/Om...
      (load-with-code-conversion "c:/Users/WorkPC/.config/doom/packages.el" ...
      (load "c:/Users/WorkPC/.config/doom/packages.el" noerror nomessage nos...
      (if (not noeval) (load file noerror 'nomessage 'nosuffix) (if (file-ex...
      (progn (if (not noeval) (load file noerror 'nomessage 'nosuffix) (if (...
      (unwind-protect (progn (if (not noeval) (load file noerror 'nomessage ...
      (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (...
      (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-b...
      (condition-case e (let ((temp-buffer (generate-new-buffer " *temp*" t)...
      (doom-packages--read "c:/Users/WorkPC/.config/doom/packages.el" nil no...
      (if file (doom-packages--read file nil 'noerror) nil)
      (let* ((file (and t (doom-module-locate-path (car key) (cdr key) doom-...
    ! Wrote extended backtrace to ~/.config/emacs/.local/state/logs/cli.doom.230922161852.14248.error
  ! Script was abruptly aborted, leaving Doom in an incomplete state!

需要的帮助: 如何解决?

关键信息。

看起来像是在不该用 use-package! 的地方用了 use-package!

根据doomemacs的配置文件结构:

.config/doom/packages.el 是用来声明要安装的包的,doom sync 将会执行安装,并不是配置包的地方。.config/doom/config.el 才是,你可以放到这里试试看。