欢迎使用 Nox -- 轻量级 LSP 客户端

那是旧版,最新版的已经会用你的默认字体了。

pyls用rope做重命名,不是所有的符号他都可以重名的。

eglot除了flymake没办法关之外(其实还是可以关,只是方法比较脏),剩下的都可以做到。

这里主要的问题是eldoc会一直提示文档吧?那直接把eldoc-mode关了就行。 eldoc在eglot里是optional的,不开就不会用。 (需要查看文件的时候用eglot-help-at-point即可)

同理,不用yasnippet就行。像我就一直不用snippet,把yas-minor-mode关了就好。 yasnippet在eglot一样是optional,不开启就不会用。 (我用eglot写代码从来没感觉到延迟或许就是这个原因吧)

eglot真正的dependency只有flymake,或许可以朝这个方向努力。把flymake变得跟其他package一样是optional的,只要不装就不向language server送出error checking的request。只要完成这一点我认为eglot和nox没有实质区别。

最后补充一点心得吧,我是一个坚定的eglot使用者,因为eglot代码写的好。大部分的东西都是模块化的(company, eldoc, markdown 都是optional的),并且使用Emacs built in的大部分interface (xref, imenu)。 eglot从一开始设计的时候就是尊重Emacs内部API的,而不是像lsp-mode一样后来强行加上去,所以内部的代码是非常可靠的且符合Emacs的使用逻辑的。我认为有一个完全实现LSP协议的client (e.g. eglot),同时内部完全模块化 (可将eglot里不喜欢的东西关掉让他跟nox一样)会是个更长远且效益更大的选择。 Joao是个很负责谨慎且愿意沟通的maintainer(不过他一直都很忙),我相信如果有人提出一个优雅的方法把flymake做成optional的话他会欣然接受的。

我这两天体验就是只要把实时反馈的一些小功能关掉以后,性能就很明显提升。

因为原来每次输入的时候都会有各种信息处理来阻碍你快速敲下一个字符。

删掉还来得及吗?不知 discourse 有没有撤销通知的功能。

image

我会出现这样的报错啊qwq

(我没有做任何字体的设置

joao超级棒啊,我很赞同你的观点,他的代码写的真的非常好。

只是flymake也是他写的,我这个项目主要追求速度,所以说我就直接暴力把不要的功能砍了。

不是不想沟通,只是我就想最精简的功能,也想尊重作者自己的意愿。

1 个赞

你设置一下字体呀,因为我也不知道你有啥字体。

是要求有中文字体吗?

我正常用的配置是只设了一个 firacode 也不行

不要求中文字体啊,你是怎么设置的呀?

eglot已经可以不使用flymake了(我有点久没看source code,刚刚查了一下发现多了个没在文档里标注的选项)

可以使用这个变量来控制flymake,eglot-stay-out-of,把flymake加进去之后看看符不符合你的需求。

补上相关issue Removing hard flymake dependancy for textDocument/publishDiagnostics

我已经暴力的把flymake所有的代码都删了,其实这两个项目的发展方向不一样,我只要那4个功能。

eglot还是全功能发展。

1 个赞

分享一下使用感受: 补全跳转确实比lsp-mode以及eglot快一些. 但是有一个小问题, nox-show-doc只有一种方式就是利用posframe, 那么在terminal中将变得非常奇怪. 所以我修改了一下这个函数如下:

(defvar nox--help-buffer nil)
(defun nox--get-help-buffer ()
    (or (and (buffer-live-p nox--help-buffer)
       nox--help-buffer)
      (setq nox--help-buffer (generate-new-buffer "*nox-help*"))))

(defun nox--show-doc (string)
  (let* ((bg-mode (frame-parameter nil 'background-mode))
     (background-color
      (cond ((eq bg-mode 'dark)
	     (nox-color-blend (face-background 'default) "#000000" 0.5))
	    ((eq bg-mode 'light)
	     (nox-color-blend (face-background 'default) "#000000" 0.9)))))
    (if (not window-system)
      (with-current-buffer (nox--get-help-buffer)
    (with-help-window (current-buffer)
      (with-current-buffer standard-output (insert string))
      (setq-local nobreak-char-display nil)))
      (posframe-show
       nox-doc-tooltip-name
       :string string
       :font (format "%s-%s" (frame-parameter nil 'font-parameter) nox-doc-tooltip-font-size)
       :position (point)
       :timeout nox-doc-tooltip-timeout
       :background-color background-color
       :foreground-color (face-attribute 'default :foreground)
       :internal-border-width nox-doc-tooltip-border-width)
      )))

最新版会自动判断图形还是终端环境,图形用 posframe, 终端用 buffer.

请教一个问题:

使用nox+ccls补全c文件。但是我的c文件不是以c结尾的,以.pc结尾。这样 xref-find-definitions 使用不了。感觉好像是超时了。报错如下:

Debugger entered--Lisp error: (jsonrpc-error "request id=5 failed:" (jsonrpc-error-code . -32600) (jsonrpc-error-message . "not indexed") (jsonrpc-error-data))
  signal(jsonrpc-error ("request id=5 failed:" (jsonrpc-error-code . -32600) (jsonrpc-error-message . "not indexed") (jsonrpc-error-data)))
  (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval))))
  (if (eq 'error (car retval)) (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval)))))
  (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer cancelled (retval (unwind-protect (catch tag (setq id-and-timer (jsonrpc--async-request-1 connection method params :success-fn (function (lambda (result) (if cancelled nil (throw tag (list 'done result))))) :error-fn (function (lambda (jsonrpc-lambda-elem34) (apply (function (lambda (&rest --cl-rest--) "\n\n(fn &key CODE MESSAGE DATA)" (let* ((code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message)))) (data (car (cdr (plist-member --cl-rest-- ':data))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:code :message :data :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:code :message :data)" (car --cl-keys--)))))) (if cancelled nil (throw tag (list 'error (cons 'jsonrpc-error-code code) (cons 'jsonrpc-error-message message) (cons 'jsonrpc-error-data data)))))))) jsonrpc-lambda-elem34))) :timeout-fn (function (lambda nil (if cancelled nil (throw tag '(error (jsonrpc-error-message . "Timed out")))))) :deferred deferred :timeout timeout)) (cond (cancel-on-input (while (sit-for 30)) (setq cancelled t) (list 'cancelled cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) (let* ((x8 (car id-and-timer)) (x9 (cdr id-and-timer)) (x10 (car x9)) (x11 (cdr x9))) (let ((timer x10) (id x8)) (progn (remhash id (jsonrpc--request-continuations connection)) (remhash (list deferred (current-buffer)) (jsonrpc--deferred-actions connection)) (if timer (progn (cancel-timer timer))))))))) (if (eq 'error (car retval)) (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval))))) (car (cdr retval)))
  (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:deferred :timeout :cancel-on-input :cancel-on-input-retval :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:deferred :timeout :cancel-on-input :cancel-on-input-retval)" (car --cl-keys--)))))) (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer cancelled (retval (unwind-protect (catch tag (setq id-and-timer (jsonrpc--async-request-1 connection method params :success-fn (function (lambda (result) (if cancelled nil (throw tag (list 'done result))))) :error-fn (function (lambda (jsonrpc-lambda-elem34) (apply (function (lambda (&rest --cl-rest--) "\n\n(fn &key CODE MESSAGE DATA)" (let* ((code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message)))) (data (car (cdr (plist-member --cl-rest-- ':data))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:code :message :data :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:code :message :data)" (car --cl-keys--)))))) (if cancelled nil (throw tag (list 'error (cons 'jsonrpc-error-code code) (cons 'jsonrpc-error-message message) (cons 'jsonrpc-error-data data)))))))) jsonrpc-lambda-elem34))) :timeout-fn (function (lambda nil (if cancelled nil (throw tag '(error (jsonrpc-error-message . "Timed out")))))) :deferred deferred :timeout timeout)) (cond (cancel-on-input (while (sit-for 30)) (setq cancelled t) (list 'cancelled cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) (let* ((x8 (car id-and-timer)) (x9 (cdr id-and-timer)) (x10 (car x9)) (x11 (cdr x9))) (let ((timer x10) (id x8)) (progn (remhash id (jsonrpc--request-continuations connection)) (remhash (list deferred (current-buffer)) (jsonrpc--deferred-actions connection)) (if timer (progn (cancel-timer timer))))))))) (if (eq 'error (car retval)) (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval))))) (car (cdr retval))))
  (let* ((deferred (car (cdr (plist-member --cl-rest-- ':deferred)))) (timeout (car (cdr (plist-member --cl-rest-- ':timeout)))) (cancel-on-input (car (cdr (plist-member --cl-rest-- ':cancel-on-input)))) (cancel-on-input-retval (car (cdr (plist-member --cl-rest-- ':cancel-on-input-retval))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:deferred :timeout :cancel-on-input :cancel-on-input-retval :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:deferred :timeout :cancel-on-input :cancel-on-input-retval)" (car --cl-keys--)))))) (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer cancelled (retval (unwind-protect (catch tag (setq id-and-timer (jsonrpc--async-request-1 connection method params :success-fn (function (lambda (result) (if cancelled nil (throw tag (list 'done result))))) :error-fn (function (lambda (jsonrpc-lambda-elem34) (apply (function (lambda (&rest --cl-rest--) "\n\n(fn &key CODE MESSAGE DATA)" (let* ((code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message)))) (data (car (cdr (plist-member --cl-rest-- ':data))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:code :message :data :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:code :message :data)" (car --cl-keys--)))))) (if cancelled nil (throw tag (list 'error (cons 'jsonrpc-error-code code) (cons 'jsonrpc-error-message message) (cons 'jsonrpc-error-data data)))))))) jsonrpc-lambda-elem34))) :timeout-fn (function (lambda nil (if cancelled nil (throw tag '(error (jsonrpc-error-message . "Timed out")))))) :deferred deferred :timeout timeout)) (cond (cancel-on-input (while (sit-for 30)) (setq cancelled t) (list 'cancelled cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) (let* ((x8 (car id-and-timer)) (x9 (cdr id-and-timer)) (x10 (car x9)) (x11 (cdr x9))) (let ((timer x10) (id x8)) (progn (remhash id (jsonrpc--request-continuations connection)) (remhash (list deferred (current-buffer)) (jsonrpc--deferred-actions connection)) (if timer (progn (cancel-timer timer))))))))) (if (eq 'error (car retval)) (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval))))) (car (cdr retval)))))
  (closure (t) (connection method params &rest --cl-rest--) "Make a request to CONNECTION, wait for a reply.\nLike `jsonrpc-async-request' for CONNECTION, METHOD and PARAMS,\nbut synchronous.\n\nExcept in the case of a non-nil CANCEL-ON-INPUT (explained\nbelow), this function doesn't exit until anything interesting\nhappens (success reply, error reply, or timeout).  Furthermore,\nit only exits locally (returning the JSONRPC result object) if\nthe request is successful, otherwise it exits non-locally with an\nerror of type `jsonrpc-error'.\n\nDEFERRED is passed to `jsonrpc-async-request', which see.\n\nIf CANCEL-ON-INPUT is non-nil and the user inputs something while\nthe functino is waiting, then it exits immediately, returning\nCANCEL-ON-INPUT-RETVAL.  Any future replies (normal or error) are\nignored.\n\n(fn CONNECTION METHOD PARAMS &key DEFERRED TIMEOUT CANCEL-ON-INPUT CANCEL-ON-INPUT-RETVAL)" (let* ((deferred (car (cdr (plist-member --cl-rest-- ':deferred)))) (timeout (car (cdr (plist-member --cl-rest-- ':timeout)))) (cancel-on-input (car (cdr (plist-member --cl-rest-- ':cancel-on-input)))) (cancel-on-input-retval (car (cdr (plist-member --cl-rest-- ':cancel-on-input-retval))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:deferred :timeout :cancel-on-input :cancel-on-input-retval :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:deferred :timeout :cancel-on-input :cancel-on-input-retval)" (car --cl-keys--)))))) (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer cancelled (retval (unwind-protect (catch tag (setq id-and-timer (jsonrpc--async-request-1 connection method params :success-fn (function (lambda (result) (if cancelled nil (throw tag (list 'done result))))) :error-fn (function (lambda (jsonrpc-lambda-elem34) (apply (function (lambda (&rest --cl-rest--) "\n\n(fn &key CODE MESSAGE DATA)" (let* ((code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message)))) (data (car (cdr (plist-member --cl-rest-- ':data))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:code :message :data :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:code :message :data)" (car --cl-keys--)))))) (if cancelled nil (throw tag (list 'error (cons 'jsonrpc-error-code code) (cons 'jsonrpc-error-message message) (cons 'jsonrpc-error-data data)))))))) jsonrpc-lambda-elem34))) :timeout-fn (function (lambda nil (if cancelled nil (throw tag '(error (jsonrpc-error-message . "Timed out")))))) :deferred deferred :timeout timeout)) (cond (cancel-on-input (while (sit-for 30)) (setq cancelled t) (list 'cancelled cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) (let* ((x8 (car id-and-timer)) (x9 (cdr id-and-timer)) (x10 (car x9)) (x11 (cdr x9))) (let ((timer x10) (id x8)) (progn (remhash id (jsonrpc--request-continuations connection)) (remhash (list deferred (current-buffer)) (jsonrpc--deferred-actions connection)) (if timer (progn (cancel-timer timer))))))))) (if (eq 'error (car retval)) (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval))))) (car (cdr retval))))))(#<nox-lsp-server nox-lsp-server> :textDocument/definition (:textDocument (:uri "file:///Users/pengpengxp/work/youzheng%E9%82%AE%E6%94%BF/src/cpab_cvs/cpab3/src/BUSI/TSA/ACC/BJ/TX760596.pc") :position (:line 159 :character 42)))
  apply((closure (t) (connection method params &rest --cl-rest--) "Make a request to CONNECTION, wait for a reply.\nLike `jsonrpc-async-request' for CONNECTION, METHOD and PARAMS,\nbut synchronous.\n\nExcept in the case of a non-nil CANCEL-ON-INPUT (explained\nbelow), this function doesn't exit until anything interesting\nhappens (success reply, error reply, or timeout).  Furthermore,\nit only exits locally (returning the JSONRPC result object) if\nthe request is successful, otherwise it exits non-locally with an\nerror of type `jsonrpc-error'.\n\nDEFERRED is passed to `jsonrpc-async-request', which see.\n\nIf CANCEL-ON-INPUT is non-nil and the user inputs something while\nthe functino is waiting, then it exits immediately, returning\nCANCEL-ON-INPUT-RETVAL.  Any future replies (normal or error) are\nignored.\n\n(fn CONNECTION METHOD PARAMS &key DEFERRED TIMEOUT CANCEL-ON-INPUT CANCEL-ON-INPUT-RETVAL)" (let* ((deferred (car (cdr (plist-member --cl-rest-- ':deferred)))) (timeout (car (cdr (plist-member --cl-rest-- ':timeout)))) (cancel-on-input (car (cdr (plist-member --cl-rest-- ':cancel-on-input)))) (cancel-on-input-retval (car (cdr (plist-member --cl-rest-- ':cancel-on-input-retval))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:deferred :timeout :cancel-on-input :cancel-on-input-retval :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:deferred :timeout :cancel-on-input :cancel-on-input-retval)" (car --cl-keys--)))))) (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer cancelled (retval (unwind-protect (catch tag (setq id-and-timer (jsonrpc--async-request-1 connection method params :success-fn (function (lambda (result) (if cancelled nil (throw tag (list 'done result))))) :error-fn (function (lambda (jsonrpc-lambda-elem34) (apply (function (lambda (&rest --cl-rest--) "\n\n(fn &key CODE MESSAGE DATA)" (let* ((code (car (cdr (plist-member --cl-rest-- ':code)))) (message (car (cdr (plist-member --cl-rest-- ':message)))) (data (car (cdr (plist-member --cl-rest-- ':data))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:code :message :data :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:code :message :data)" (car --cl-keys--)))))) (if cancelled nil (throw tag (list 'error (cons 'jsonrpc-error-code code) (cons 'jsonrpc-error-message message) (cons 'jsonrpc-error-data data)))))))) jsonrpc-lambda-elem34))) :timeout-fn (function (lambda nil (if cancelled nil (throw tag '(error (jsonrpc-error-message . "Timed out")))))) :deferred deferred :timeout timeout)) (cond (cancel-on-input (while (sit-for 30)) (setq cancelled t) (list 'cancelled cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) (let* ((x8 (car id-and-timer)) (x9 (cdr id-and-timer)) (x10 (car x9)) (x11 (cdr x9))) (let ((timer x10) (id x8)) (progn (remhash id (jsonrpc--request-continuations connection)) (remhash (list deferred (current-buffer)) (jsonrpc--deferred-actions connection)) (if timer (progn (cancel-timer timer))))))))) (if (eq 'error (car retval)) (progn (signal 'jsonrpc-error (cons (format "request id=%s failed:" (car id-and-timer)) (cdr retval))))) (car (cdr retval)))))) (#<nox-lsp-server nox-lsp-server> :textDocument/definition (:textDocument (:uri "file:///Users/pengpengxp/work/youzheng%E9%82%AE%E6%94%BF/src/cpab_cvs/cpab3/src/BUSI/TSA/ACC/BJ/TX760596.pc") :position (:line 159 :character 42))))
  jsonrpc-request(#<nox-lsp-server nox-lsp-server> :textDocument/definition (:textDocument (:uri "file:///Users/pengpengxp/work/youzheng%E9%82%AE%E6%94%BF/src/cpab_cvs/cpab3/src/BUSI/TSA/ACC/BJ/TX760596.pc") :position (:line 159 :character 42)))
  (let ((response (jsonrpc-request (nox--current-server-or-lose) method (append (nox--TextDocumentPositionParams) extra-params)))) (unwind-protect (let (collected43) (let* ((--cl-collect-- (function (lambda (xref) (setq collected43 (cons xref collected43)))))) (progn (mapc (function (lambda (jsonrpc-lambda-elem44) (let ((object-once jsonrpc-lambda-elem44)) (let* ((--cl-rest-- object-once) (uri (car (cdr (plist-member --cl-rest-- ':uri)))) (range (car (cdr (plist-member --cl-rest-- ':range))))) (nox--call-with-interface (assoc 'Location nox--lsp-interface-alist) object-once (function (lambda nil (funcall --cl-collect-- (nox--xref-make (symbol-at-point) uri range))))))))) (if (vectorp response) response (list response))))) (sort collected43 nox-xref-lessp-function)) (maphash (function (lambda (_uri buf) (kill-buffer buf))) nox--temp-location-buffers) (clrhash nox--temp-location-buffers)))
  (progn (if (nox--server-capable (or capability (intern (format ":%sProvider" (car (cdr (split-string (symbol-name method) "/"))))))) nil (nox--error "Sorry, this server doesn't do %s" method)) (let ((response (jsonrpc-request (nox--current-server-or-lose) method (append (nox--TextDocumentPositionParams) extra-params)))) (unwind-protect (let (collected43) (let* ((--cl-collect-- (function (lambda (xref) (setq collected43 (cons xref collected43)))))) (progn (mapc (function (lambda (jsonrpc-lambda-elem44) (let ((object-once jsonrpc-lambda-elem44)) (let* ((--cl-rest-- object-once) (uri (car (cdr (plist-member --cl-rest-- ':uri)))) (range (car (cdr (plist-member --cl-rest-- ':range))))) (nox--call-with-interface (assoc 'Location nox--lsp-interface-alist) object-once (function (lambda nil (funcall --cl-collect-- (nox--xref-make (symbol-at-point) uri range))))))))) (if (vectorp response) response (list response))))) (sort collected43 nox-xref-lessp-function)) (maphash (function (lambda (_uri buf) (kill-buffer buf))) nox--temp-location-buffers) (clrhash nox--temp-location-buffers))))
  (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:extra-params :capability :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:extra-params :capability)" (car --cl-keys--)))))) (progn (if (nox--server-capable (or capability (intern (format ":%sProvider" (car (cdr (split-string (symbol-name method) "/"))))))) nil (nox--error "Sorry, this server doesn't do %s" method)) (let ((response (jsonrpc-request (nox--current-server-or-lose) method (append (nox--TextDocumentPositionParams) extra-params)))) (unwind-protect (let (collected43) (let* ((--cl-collect-- (function (lambda (xref) (setq collected43 (cons xref collected43)))))) (progn (mapc (function (lambda (jsonrpc-lambda-elem44) (let ((object-once jsonrpc-lambda-elem44)) (let* ((--cl-rest-- object-once) (uri (car (cdr (plist-member --cl-rest-- ':uri)))) (range (car (cdr (plist-member --cl-rest-- ':range))))) (nox--call-with-interface (assoc 'Location nox--lsp-interface-alist) object-once (function (lambda nil (funcall --cl-collect-- (nox--xref-make (symbol-at-point) uri range))))))))) (if (vectorp response) response (list response))))) (sort collected43 nox-xref-lessp-function)) (maphash (function (lambda (_uri buf) (kill-buffer buf))) nox--temp-location-buffers) (clrhash nox--temp-location-buffers)))))
  (let* ((extra-params (car (cdr (plist-member --cl-rest-- ':extra-params)))) (capability (car (cdr (plist-member --cl-rest-- ':capability))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:extra-params :capability :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:extra-params :capability)" (car --cl-keys--)))))) (progn (if (nox--server-capable (or capability (intern (format ":%sProvider" (car (cdr (split-string (symbol-name method) "/"))))))) nil (nox--error "Sorry, this server doesn't do %s" method)) (let ((response (jsonrpc-request (nox--current-server-or-lose) method (append (nox--TextDocumentPositionParams) extra-params)))) (unwind-protect (let (collected43) (let* ((--cl-collect-- (function (lambda (xref) (setq collected43 (cons xref collected43)))))) (progn (mapc (function (lambda (jsonrpc-lambda-elem44) (let ((object-once jsonrpc-lambda-elem44)) (let* ((--cl-rest-- object-once) (uri (car (cdr (plist-member --cl-rest-- ':uri)))) (range (car (cdr (plist-member --cl-rest-- ':range))))) (nox--call-with-interface (assoc 'Location nox--lsp-interface-alist) object-once (function (lambda nil (funcall --cl-collect-- (nox--xref-make (symbol-at-point) uri range))))))))) (if (vectorp response) response (list response))))) (sort collected43 nox-xref-lessp-function)) (maphash (function (lambda (_uri buf) (kill-buffer buf))) nox--temp-location-buffers) (clrhash nox--temp-location-buffers))))))
  nox--lsp-xrefs-for-method(:textDocument/definition)
  (progn (nox--lsp-xrefs-for-method :textDocument/definition))
  (closure (revert-buffer-preserve-modes nox--managed-mode t) (_backend _identifier) (progn (nox--lsp-xrefs-for-method :textDocument/definition)))(nox "LSP identifier at point.")
  apply((closure (revert-buffer-preserve-modes nox--managed-mode t) (_backend _identifier) (progn (nox--lsp-xrefs-for-method :textDocument/definition))) nox "LSP identifier at point.")
  xref-backend-definitions(nox "LSP identifier at point.")
  xref--find-xrefs("LSP identifier at point." definitions "LSP identifier at point." nil)
  xref--find-definitions("LSP identifier at point." nil)
  xref-find-definitions("LSP identifier at point.")
  funcall-interactively(xref-find-definitions "LSP identifier at point.")
  call-interactively(xref-find-definitions nil nil)
  command-execute(xref-find-definitions)

这个问题是client的问题还是server端的问题呢?大家有遇到过吗?我感觉大概率像是server端的原因?

看报错是服务端的错误,需要报给ccls

这个只是 not indexed, 再过一会等它索引好了就行了

收到。我再研究下。谢谢

好哒。我再研究下哈。谢谢亲。

这个补丁用 VSCode 的 intelephense 作为PHP的补全后端,并修复了 Nox 发送 initialization 请求时Server返回 dataPaths 的错误。

增加了 nox-php-server ,默认用 intelephense, 可以切换成 php-language-server