lsp + ccls 高亮异常报错:函数未定义 (void-function lsp:ccls-semantic-highlight-symbol-ranges)

系统:ubuntu-20.04

emacs版本:27 使用spacemacs develop分支。

问题:lsp + ccls 没有高亮。

理想的高亮:

出错信息:

Error processing message (void-function lsp:ccls-semantic-highlight-symbol-ranges).

我的配置:

     (lsp :variables
          lsp-ui-sideline-enable nil
          lsp-ui-flycheck-enable t
          lsp-ui-doc-enable nil
          )
     (c-c++ :variables
            c-c++-adopt-subprojects t
            c-c++-backend 'lsp-ccls
            c-c++-lsp-enable-semantic-highlight t)

除了高亮之外其他功能正常,各位道友有什么想法吗?

贴一下debug信息?

Debugger entered--Lisp error: (void-function lsp:ccls-semantic-highlight-symbol-ranges)
  lsp:ccls-semantic-highlight-symbol-ranges(#<hash-table equal 6/65 0x1ffff837c6d1>)
  #f(compiled-function (symbol) #<bytecode 0x1ffff74ac1f5>)(#<hash-table equal 6/65 0x1ffff837c6d1>)
  mapc(#f(compiled-function (symbol) #<bytecode 0x1ffff74ac1f5>) [#<hash-table equal 6/65 0x1ffff837c6d1> #<hash-table equal 6/65 0x1ffff837c795> #<hash-table equal 6/65 0x1ffff6c5701d> #<hash-table equal 6/65 0x1ffff6c5705d> #<hash-table equal 6/65 0x1ffff7eb89cd> #<hash-table equal 6/65 0x1ffff7eb8c1d> #<hash-table equal 6/65 0x1ffff7eb8c5d> #<hash-table equal 6/65 0x1ffff78ca1f9> #<hash-table equal 6/65 0x1ffff78ca239> #<hash-table equal 6/65 0x1ffff6afc711> #<hash-table equal 6/65 0x1ffff6afc751> #<hash-table equal 6/65 0x1ffff7f9fb59> #<hash-table equal 6/65 0x1ffff7f9fb99> #<hash-table equal 6/65 0x1ffff7fd00a9> #<hash-table equal 6/65 0x1ffff7fd00e9> #<hash-table equal 6/65 0x1fd1ba4048ed> #<hash-table equal 6/65 0x1fd1ba40492d> #<hash-table equal 6/65 0x1ffff78c0bad> #<hash-table equal 6/65 0x1ffff78c0d79> #<hash-table equal 6/65 0x1ffff6c6043d> #<hash-table equal 6/65 0x1ffff72d2705> #<hash-table equal 6/65 0x1ffff742b7bd> #<hash-table equal 6/65 0x1ffff7835bad> #<hash-table equal 6/65 0x1ffff7859ed1> #<hash-table equal 6/65 0x1ffff79039a1> #<hash-table equal 6/65 0x1ffff7e31a35> #<hash-table equal 6/65 0x1ffff7e77be5> #<hash-table equal 6/65 0x1ffff7e834b1> #<hash-table equal 6/65 0x1ffff81b8191> #<hash-table equal 6/65 0x1ffff824ef0d> #<hash-table equal 6/65 0x1ffff8328935> #<hash-table equal 6/65 0x1fd1b6e5950d> #<hash-table equal 6/65 0x1ffff8086a19> #<hash-table equal 6/65 0x1ffff7988131> #<hash-table equal 6/65 0x1ffff7046a51> #<hash-table equal 6/65 0x1ffff7258645> #<hash-table equal 6/65 0x1ffff6fcbb49> #<hash-table equal 6/65 0x1ffff7137941> #<hash-table equal 6/65 0x1ffff7d7a8ed> #<hash-table equal 6/65 0x1ffff8065961> #<hash-table equal 6/65 0x1fd1b6cc90bd> #<hash-table equal 6/65 0x1ffff7d25a41> #<hash-table equal 6/65 0x1fd1ba07b6d9> #<hash-table equal 6/65 0x1ffff6bad199> #<hash-table equal 6/65 0x1ffff711fcc9> #<hash-table equal 6/65 0x1ffff7859869> #<hash-table equal 6/65 0x1ffff7ca55b1> #<hash-table equal 6/65 0x1ffff6c50831> #<hash-table equal 6/65 0x1ffff758fa45> #<hash-table equal 6/65 0x1ffff7127ec1> ...])
  seq-do(#f(compiled-function (symbol) #<bytecode 0x1ffff74ac1f5>) [#<hash-table equal 6/65 0x1ffff837c6d1> #<hash-table equal 6/65 0x1ffff837c795> #<hash-table equal 6/65 0x1ffff6c5701d> #<hash-table equal 6/65 0x1ffff6c5705d> #<hash-table equal 6/65 0x1ffff7eb89cd> #<hash-table equal 6/65 0x1ffff7eb8c1d> #<hash-table equal 6/65 0x1ffff7eb8c5d> #<hash-table equal 6/65 0x1ffff78ca1f9> #<hash-table equal 6/65 0x1ffff78ca239> #<hash-table equal 6/65 0x1ffff6afc711> #<hash-table equal 6/65 0x1ffff6afc751> #<hash-table equal 6/65 0x1ffff7f9fb59> #<hash-table equal 6/65 0x1ffff7f9fb99> #<hash-table equal 6/65 0x1ffff7fd00a9> #<hash-table equal 6/65 0x1ffff7fd00e9> #<hash-table equal 6/65 0x1fd1ba4048ed> #<hash-table equal 6/65 0x1fd1ba40492d> #<hash-table equal 6/65 0x1ffff78c0bad> #<hash-table equal 6/65 0x1ffff78c0d79> #<hash-table equal 6/65 0x1ffff6c6043d> #<hash-table equal 6/65 0x1ffff72d2705> #<hash-table equal 6/65 0x1ffff742b7bd> #<hash-table equal 6/65 0x1ffff7835bad> #<hash-table equal 6/65 0x1ffff7859ed1> #<hash-table equal 6/65 0x1ffff79039a1> #<hash-table equal 6/65 0x1ffff7e31a35> #<hash-table equal 6/65 0x1ffff7e77be5> #<hash-table equal 6/65 0x1ffff7e834b1> #<hash-table equal 6/65 0x1ffff81b8191> #<hash-table equal 6/65 0x1ffff824ef0d> #<hash-table equal 6/65 0x1ffff8328935> #<hash-table equal 6/65 0x1fd1b6e5950d> #<hash-table equal 6/65 0x1ffff8086a19> #<hash-table equal 6/65 0x1ffff7988131> #<hash-table equal 6/65 0x1ffff7046a51> #<hash-table equal 6/65 0x1ffff7258645> #<hash-table equal 6/65 0x1ffff6fcbb49> #<hash-table equal 6/65 0x1ffff7137941> #<hash-table equal 6/65 0x1ffff7d7a8ed> #<hash-table equal 6/65 0x1ffff8065961> #<hash-table equal 6/65 0x1fd1b6cc90bd> #<hash-table equal 6/65 0x1ffff7d25a41> #<hash-table equal 6/65 0x1fd1ba07b6d9> #<hash-table equal 6/65 0x1ffff6bad199> #<hash-table equal 6/65 0x1ffff711fcc9> #<hash-table equal 6/65 0x1ffff7859869> #<hash-table equal 6/65 0x1ffff7ca55b1> #<hash-table equal 6/65 0x1ffff6c50831> #<hash-table equal 6/65 0x1ffff758fa45> #<hash-table equal 6/65 0x1ffff7127ec1> ...])
  ccls--publish-semantic-highlight(#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/65 0x1ffff7db3071> :registered-server-capabilities (#s(lsp--registered-capability :id "didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/65 0x1ffff72c0f29>)) :root "/mnt/i/OneDrive - sjtu.edu.cn/Document/code/school..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1ffff7991e75>) :test\? #f(compiled-function () #<bytecode 0x1ffff7991e81>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x1ffff7bd543d> :request-handlers #<hash-table equal 0/65 0x1ffff7bd545d> :response-handlers #<hash-table eql 3/65 0x1ffff7120631> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ffff7e63a49> :action-handlers #<hash-table equal 0/65 0x1ffff7106a4d> :major-modes (c-mode c++-mode cuda-mode objc-mode) :activation-fn nil :priority 0 :server-id ccls :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0x1ffff77e6d51>) :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x1ffff77f73d5> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process ccls> :cmd-proc #<process ccls> :buffers (#<buffer sysctl.c> #<buffer StepMotor-2.c>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1ffff7ca7ac5> :watches #<hash-table equal 0/65 0x1ffff6bbedc1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 1/65 0x1ffff7106f61> :work-done-tokens #<hash-table equal 0/65 0x1ffff7106f81>) #<hash-table equal 2/65 0x1ffff81a1289>)
  lsp--on-notification(#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/65 0x1ffff7db3071> :registered-server-capabilities (#s(lsp--registered-capability :id "didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/65 0x1ffff72c0f29>)) :root "/mnt/i/OneDrive - sjtu.edu.cn/Document/code/school..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1ffff7991e75>) :test\? #f(compiled-function () #<bytecode 0x1ffff7991e81>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x1ffff7bd543d> :request-handlers #<hash-table equal 0/65 0x1ffff7bd545d> :response-handlers #<hash-table eql 3/65 0x1ffff7120631> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ffff7e63a49> :action-handlers #<hash-table equal 0/65 0x1ffff7106a4d> :major-modes (c-mode c++-mode cuda-mode objc-mode) :activation-fn nil :priority 0 :server-id ccls :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0x1ffff77e6d51>) :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x1ffff77f73d5> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process ccls> :cmd-proc #<process ccls> :buffers (#<buffer sysctl.c> #<buffer StepMotor-2.c>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1ffff7ca7ac5> :watches #<hash-table equal 0/65 0x1ffff6bbedc1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 1/65 0x1ffff7106f61> :work-done-tokens #<hash-table equal 0/65 0x1ffff7106f81>) #<hash-table equal 3/65 0x1ffff81a1161>)
  lsp--parser-on-message(#<hash-table equal 3/65 0x1ffff81a1161> #s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/65 0x1ffff7db3071> :registered-server-capabilities (#s(lsp--registered-capability :id "didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/65 0x1ffff72c0f29>)) :root "/mnt/i/OneDrive - sjtu.edu.cn/Document/code/school..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1ffff7991e75>) :test\? #f(compiled-function () #<bytecode 0x1ffff7991e81>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x1ffff7bd543d> :request-handlers #<hash-table equal 0/65 0x1ffff7bd545d> :response-handlers #<hash-table eql 3/65 0x1ffff7120631> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x1ffff7e63a49> :action-handlers #<hash-table equal 0/65 0x1ffff7106a4d> :major-modes (c-mode c++-mode cuda-mode objc-mode) :activation-fn nil :priority 0 :server-id ccls :multi-root nil :initialization-options #f(compiled-function () #<bytecode 0x1ffff77e6d51>) :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x1ffff77f73d5> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process ccls> :cmd-proc #<process ccls> :buffers (#<buffer sysctl.c> #<buffer StepMotor-2.c>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1ffff7ca7ac5> :watches #<hash-table equal 0/65 0x1ffff6bbedc1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 1/65 0x1ffff7106f61> :work-done-tokens #<hash-table equal 0/65 0x1ffff7106f81>))
  #f(compiled-function (proc input) #<bytecode 0x1ffff72dd905>)(#<process ccls> "Content-Length: 554\15\n\15\n{\"jsonrpc\":\"2.0\",\"method\":\"...")

我在github上提了个issue,已经关闭了,你可以去看看解决的办法。手机码不了代码,见谅。

可以试试 lsp + clangd,体验目前感觉下来比lsp + ccls 要好
PS: 我的用的是clangd-10