[求助] 怎么修改eglot默认的eglot-server-programs参数?

刚从lsp-mode换到eglot,在加载yaml-lsp-server时出错了,检查eglot-server-programs发现yaml-mode是eglot默认支持的,但是由于我的yaml-lsp-server安装地址不在path里,导致调用找不到。我想修改eglot-server-programs的参数,把目录也传进去:(setf (car (alist-get 'yaml-mode eglot-server-programs)) “~/.emacs.d/.cache/lsp/npm/yaml-language-server/yaml-language-server”),但是失败了。查了一下yaml-mode这一条,在eglot-server-programs里是:((yaml-ts-mode yaml-mode) . (“yaml-language-server” “–stdio”)) 这种key值在alist-get函数里应该咋写啊?

不需要去修改啊,直接add-to-list就完事了

参考Eglot用户手册:

(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs
               `(yaml-mode . (,(expand-file-name "~/.emacs.d/.cache/lsp/npm/yaml-language-server/yaml-language-server")  "--studo"))))

你试试这个?不过加环境变量最方便吧?

那就把path 加到exec-path这个变量里。