win10下emacs lsp 的使用问题

想问一下有没有在windows 10 下使用lsp的小伙伴?我的感觉有问题, 打开一个cpp文件,M-x lsp-mode 感觉是正常的,但M-x lsp报错

Debugger entered--Lisp error: (wrong-number-of-arguments #<subr json-serialize> 5)
  json-serialize((:jsonrpc "2.0" :method "initialize" :params (:processId nil :rootPath "d:/code/VC++/vsproject/helloworld" :clientInfo (:name "emacs" :version "GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32)\n of 2018-06-20") :rootUri "file:///d%3A/code/VC%2B%2B/vsproject/helloworld" :capabilities ((workspace (workspaceEdit (documentChanges . t) (resourceOperations . ["create" "rename" "delete"])) (applyEdit . t) (symbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))) (executeCommand (dynamicRegistration . :json-false)) (didChangeWatchedFiles (dynamicRegistration . t)) (workspaceFolders . t) (configuration . t)) (textDocument (declaration (linkSupport . t)) (definition (linkSupport . t)) (implementation (linkSupport . t)) (typeDefinition (linkSupport . t)) (synchronization (willSave . t) (didSave . t) (willSaveWaitUntil . t)) (documentSymbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26])) (hierarchicalDocumentSymbolSupport . t)) (formatting (dynamicRegistration . t)) (rangeFormatting (dynamicRegistration . t)) (rename (dynamicRegistration . t) (prepareSupport . t)) (codeAction (dynamicRegistration . t) (isPreferredSupport . t) (codeActionLiteralSupport (codeActionKind (valueSet . ["" "quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"])))) (completion (completionItem (snippetSupport . t) (documentationFormat . ["markdown"]) (resolveAdditionalTextEditsSupport . t)) (contextSupport . t)) (signatureHelp (signatureInformation (parameterInformation (labelOffsetSupport . t)))) (documentLink (dynamicRegistration . t) (tooltipSupport . t)) (hover (contentFormat . ["markdown" "plaintext"])) (foldingRange (dynamicRegistration . t)) (callHierarchy (dynamicRegistration . :json-false)) (publishDiagnostics (relatedInformation . t) (tagSupport (valueSet . [1 2])) (versionSupport . t))) (window (workDoneProgress . t))) :initializationOptions nil :workDoneToken "1") :id 1) :null-object nil :false-object :json-false)
  lsp--make-message((:jsonrpc "2.0" :method "initialize" :params (:processId nil :rootPath "d:/code/VC++/vsproject/helloworld" :clientInfo (:name "emacs" :version "GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32)\n of 2018-06-20") :rootUri "file:///d%3A/code/VC%2B%2B/vsproject/helloworld" :capabilities ((workspace (workspaceEdit (documentChanges . t) (resourceOperations . ["create" "rename" "delete"])) (applyEdit . t) (symbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))) (executeCommand (dynamicRegistration . :json-false)) (didChangeWatchedFiles (dynamicRegistration . t)) (workspaceFolders . t) (configuration . t)) (textDocument (declaration (linkSupport . t)) (definition (linkSupport . t)) (implementation (linkSupport . t)) (typeDefinition (linkSupport . t)) (synchronization (willSave . t) (didSave . t) (willSaveWaitUntil . t)) (documentSymbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26])) (hierarchicalDocumentSymbolSupport . t)) (formatting (dynamicRegistration . t)) (rangeFormatting (dynamicRegistration . t)) (rename (dynamicRegistration . t) (prepareSupport . t)) (codeAction (dynamicRegistration . t) (isPreferredSupport . t) (codeActionLiteralSupport (codeActionKind (valueSet . ["" "quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"])))) (completion (completionItem (snippetSupport . t) (documentationFormat . ["markdown"]) (resolveAdditionalTextEditsSupport . t)) (contextSupport . t)) (signatureHelp (signatureInformation (parameterInformation (labelOffsetSupport . t)))) (documentLink (dynamicRegistration . t) (tooltipSupport . t)) (hover (contentFormat . ["markdown" "plaintext"])) (foldingRange (dynamicRegistration . t)) (callHierarchy (dynamicRegistration . :json-false)) (publishDiagnostics (relatedInformation . t) (tagSupport (valueSet . [1 2])) (versionSupport . t))) (window (workDoneProgress . t))) :initializationOptions nil :workDoneToken "1") :id 1))
  #f(compiled-function (workspace) #<bytecode 0x6a91b5>)(#s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "d:/code/VC++/vsproject/helloworld" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process clangd> :cmd-proc #<process clangd> :buffers (#<buffer main.cpp>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x6aa8ed> :watches #<hash-table equal 0/65 0x6aabc5> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x6aac69> :work-done-tokens #<hash-table equal 0/65 0x6aa865>))
  mapc(#f(compiled-function (workspace) #<bytecode 0x6a91b5>) (#s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "d:/code/VC++/vsproject/helloworld" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process clangd> :cmd-proc #<process clangd> :buffers (#<buffer main.cpp>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x6aa8ed> :watches #<hash-table equal 0/65 0x6aabc5> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x6aac69> :work-done-tokens #<hash-table equal 0/65 0x6aa865>)))
  seq-do(#f(compiled-function (workspace) #<bytecode 0x6a91b5>) (#s(lsp--workspace :ewoc nil :server-capabilities nil :registered-server-capabilities nil :root "d:/code/VC++/vsproject/helloworld" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process clangd> :cmd-proc #<process clangd> :buffers (#<buffer main.cpp>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status starting :metadata #<hash-table equal 0/65 0x6aa8ed> :watches #<hash-table equal 0/65 0x6aabc5> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x6aac69> :work-done-tokens #<hash-table equal 0/65 0x6aa865>)))
  lsp--send-request-async((:jsonrpc "2.0" :method "initialize" :params (:processId nil :rootPath "d:/code/VC++/vsproject/helloworld" :clientInfo (:name "emacs" :version "GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32)\n of 2018-06-20") :rootUri "file:///d%3A/code/VC%2B%2B/vsproject/helloworld" :capabilities ((workspace (workspaceEdit (documentChanges . t) (resourceOperations . ["create" "rename" "delete"])) (applyEdit . t) (symbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))) (executeCommand (dynamicRegistration . :json-false)) (didChangeWatchedFiles (dynamicRegistration . t)) (workspaceFolders . t) (configuration . t)) (textDocument (declaration (linkSupport . t)) (definition (linkSupport . t)) (implementation (linkSupport . t)) (typeDefinition (linkSupport . t)) (synchronization (willSave . t) (didSave . t) (willSaveWaitUntil . t)) (documentSymbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26])) (hierarchicalDocumentSymbolSupport . t)) (formatting (dynamicRegistration . t)) (rangeFormatting (dynamicRegistration . t)) (rename (dynamicRegistration . t) (prepareSupport . t)) (codeAction (dynamicRegistration . t) (isPreferredSupport . t) (codeActionLiteralSupport (codeActionKind (valueSet . ["" "quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"])))) (completion (completionItem (snippetSupport . t) (documentationFormat . ["markdown"]) (resolveAdditionalTextEditsSupport . t)) (contextSupport . t)) (signatureHelp (signatureInformation (parameterInformation (labelOffsetSupport . t)))) (documentLink (dynamicRegistration . t) (tooltipSupport . t)) (hover (contentFormat . ["markdown" "plaintext"])) (foldingRange (dynamicRegistration . t)) (callHierarchy (dynamicRegistration . :json-false)) (publishDiagnostics (relatedInformation . t) (tagSupport (valueSet . [1 2])) (versionSupport . t))) (window (workDoneProgress . t))) :initializationOptions nil :workDoneToken "1") :id 1) #f(compiled-function (response) #<bytecode 0x6a982d>) detached nil nil nil nil)
  lsp-request-async("initialize" (:processId nil :rootPath "d:/code/VC++/vsproject/helloworld" :clientInfo (:name "emacs" :version "GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32)\n of 2018-06-20") :rootUri "file:///d%3A/code/VC%2B%2B/vsproject/helloworld" :capabilities ((workspace (workspaceEdit (documentChanges . t) (resourceOperations . ["create" "rename" "delete"])) (applyEdit . t) (symbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))) (executeCommand (dynamicRegistration . :json-false)) (didChangeWatchedFiles (dynamicRegistration . t)) (workspaceFolders . t) (configuration . t)) (textDocument (declaration (linkSupport . t)) (definition (linkSupport . t)) (implementation (linkSupport . t)) (typeDefinition (linkSupport . t)) (synchronization (willSave . t) (didSave . t) (willSaveWaitUntil . t)) (documentSymbol (symbolKind (valueSet . [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26])) (hierarchicalDocumentSymbolSupport . t)) (formatting (dynamicRegistration . t)) (rangeFormatting (dynamicRegistration . t)) (rename (dynamicRegistration . t) (prepareSupport . t)) (codeAction (dynamicRegistration . t) (isPreferredSupport . t) (codeActionLiteralSupport (codeActionKind (valueSet . ["" "quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"])))) (completion (completionItem (snippetSupport . t) (documentationFormat . ["markdown"]) (resolveAdditionalTextEditsSupport . t)) (contextSupport . t)) (signatureHelp (signatureInformation (parameterInformation (labelOffsetSupport . t)))) (documentLink (dynamicRegistration . t) (tooltipSupport . t)) (hover (contentFormat . ["markdown" "plaintext"])) (foldingRange (dynamicRegistration . t)) (callHierarchy (dynamicRegistration . :json-false)) (publishDiagnostics (relatedInformation . t) (tagSupport (valueSet . [1 2])) (versionSupport . t))) (window (workDoneProgress . t))) :initializationOptions nil :workDoneToken "1") #f(compiled-function (response) #<bytecode 0x6a982d>) :mode detached)
  lsp--start-workspace(#s(lsp-session :folders ("d:/code/VC++/vsproject/helloworld" "d:/code/python" "d:/code/iar/iarwork/source" "e:/gitrep/Machine-Learning-From-Scratch") :folders-blacklist nil :server-id->folders #<hash-table equal 0/65 0x6a6d91> :folder->servers #<hash-table equal 1/65 0x6a8c8d> :metadata #<hash-table equal 0/65 0x6a8f65>) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil) "d:/code/VC++/vsproject/helloworld" nil)
  lsp--start-connection(#s(lsp-session :folders ("d:/code/VC++/vsproject/helloworld" "d:/code/python" "d:/code/iar/iarwork/source" "e:/gitrep/Machine-Learning-From-Scratch") :folders-blacklist nil :server-id->folders #<hash-table equal 0/65 0x6a6d91> :folder->servers #<hash-table equal 1/65 0x6a8c8d> :metadata #<hash-table equal 0/65 0x6a8f65>) #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil) "d:/code/VC++/vsproject/helloworld")
  #f(compiled-function (client) #<bytecode 0x6a7815>)(#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil))
  mapcar(#f(compiled-function (client) #<bytecode 0x6a7815>) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil)))
  -map(#f(compiled-function (client) #<bytecode 0x6a7815>) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil)))
  lsp--ensure-lsp-servers(#s(lsp-session :folders ("d:/code/VC++/vsproject/helloworld" "d:/code/python" "d:/code/iar/iarwork/source" "e:/gitrep/Machine-Learning-From-Scratch") :folders-blacklist nil :server-id->folders #<hash-table equal 0/65 0x6a6d91> :folder->servers #<hash-table equal 1/65 0x6a8c8d> :metadata #<hash-table equal 0/65 0x6a8f65>) (#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x3efaf9>) :test\? #f(compiled-function () #<bytecode 0x3efb11>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x3efb1d> :request-handlers #<hash-table equal 0/65 0x3f0a0d> :response-handlers #<hash-table eql 0/65 0x3f0d09> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3f0fe1> :action-handlers #<hash-table equal 0/65 0x3f1001> :major-modes (c-mode c++-mode objc-mode) :activation-fn nil :priority -1 :server-id clangd :multi-root nil :initialization-options nil :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 0x3f0819> :download-server-fn nil :download-in-progress? nil :buffers nil)) "d:/code/VC++/vsproject/helloworld" nil)
  lsp--try-project-root-workspaces(nil nil)
  lsp(nil)
  funcall-interactively(lsp nil)
  call-interactively(lsp record nil)
  command-execute(lsp record)
  execute-extended-command(nil "lsp" "lsp")
  funcall-interactively(execute-extended-command nil "lsp" "lsp")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

不知如何解决?网上找了半天没找到 lsp-log 显示已经连接到clangd server了 另外有没有小伙伴可以解释一下 lsp,lsp-mode它们之间的区别是什么?

lsp是服务器端,lsp-mode是客户端,lsp的emacs客户端还有tide,nox,eglot等,我在win10上tide,nox都能跑起来,但自己配置lsp-mode模块就没能跑起来,网上也没找到办法,但使用Centaur在win10上是把lsp-mode跑起来了的,就是有点卡

哦,意思是我 M-x lsp 它后台又开启了一个server是吗?然后它这个server和 我后端的clangd对接吗? 另外您说的 nox 是 lazycat 开发的对吗?它对windows是否友好呢? tide和eglot 您试过卡不卡呢

没用过clangd不清楚

nox好像只能跑在linux的系统。

只写点js的话,nox在windows上也可以,我跑着的,其实的语言好像不行

要用 lsp-deferred 就没有这个错误了,奇怪。

M-x lsp 后,doom-line 右下角一直在滚动,这正常吗? 滚动 lsp-describe-sessions 如下: 紫色的Capabilities无法点开,按道理是不是应该像 文档里的才对呢?

现在补全倒是可以补全

Nox 还不错啊,我就是在Windows下使用Nox,目前测试过在Python 和 C/C++ 上的表现还是不错的,C++ 我用的Clangd后端。配置也简单。

大佬可否分享一下nox的配置?不胜感激 :heart_eyes:

我是直接使用的作者的配置,你也可以参考一下我的配置,我对Windows 和 Clangd做了适配。他是直接通过github 仓库下载包进行配置的,你根据需要修改一下就可以了。

同时对下面几个命令进行按键根据自己的习惯进行绑定:

(lazy-load-global-keys
 '(
   ("C-7" . xref-pop-marker-stack)
   ("C-8" . xref-find-definitions)  
   ("C-9" . xref-find-definitions-other-window)
   ("C-s-f" . xref-find-references)
   ("M-," . nox-rename)
   ("M-." . nox-show-doc)
   )
 "init-nox.el")

谢谢!回去倒腾一下

不行诶,配置后,打开一个.cpp文件就出错:

Error in post-command-hook ((closure ((--cl-maybe-connect-- closure #1 nil (progn (remove-hook 'post-command-hook --cl-maybe-connect-- nil) (let ((G12 buffer)) (if (buffer-live-p G12) (save-current-buffer (set-buffer G12) (if nox--managed-mode nil (apply #'nox--connect (nox--guess-contact)))))))) (buffer . #<buffer main.cpp>) nox--managed-mode t) nil (progn (remove-hook 'post-command-hook --cl-maybe-connect-- nil) (let ((G12 buffer)) (if (buffer-live-p G12) (save-current-buffer (set-buffer G12) (if nox--managed-mode nil (apply #'nox--connect (nox--guess-contact))))))))): (wrong-number-of-arguments json-serialize 5)

使用 nox-events-buffer 也是这个错误,是不是在windows上不行呀?

Debugger entered--Lisp error: (jsonrpc-error "No current JSON-RPC connection" (jsonrpc-error-code . 32603) (jsonrpc-error-message . "No current JSON-RPC connection"))
  signal(jsonrpc-error ("No current JSON-RPC connection" (jsonrpc-error-code . 32603) (jsonrpc-error-message . "No current JSON-RPC connection")))
  (let ((msg (apply (function format-message) (car args) (cdr args)))) (signal 'jsonrpc-error (list msg (cons 'jsonrpc-error-code 32603) (cons 'jsonrpc-error-message msg))))
  (if (stringp (car args)) (let ((msg (apply (function format-message) (car args) (cdr args)))) (signal 'jsonrpc-error (list msg (cons 'jsonrpc-error-code 32603) (cons 'jsonrpc-error-message msg)))) (let* ((--cl-rest-- args) (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--)))))) (signal 'jsonrpc-error (list (format "[jsonrpc] error ") (cons 'jsonrpc-error-code code) (cons 'jsonrpc-error-message message) (cons 'jsonrpc-error-data data))))))
  jsonrpc-error("No current JSON-RPC connection")
  (or nox--cached-server (jsonrpc-error "No current JSON-RPC connection"))
  nox--current-server-or-lose()
  (list (nox--current-server-or-lose))
  call-interactively(nox-events-buffer record nil)
  command-execute(nox-events-buffer record)
  execute-extended-command(nil "nox-events-buffer" "nox-eve")
  funcall-interactively(execute-extended-command nil "nox-events-buffer" "nox-eve")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

使用Clangd的话,你得安装llvm,如果没有安装的话,可以通过chocolate 安装。安装好chocolate后用下面命令就可以。另外一个方案是用ccls,但是编译难度大一些。

choco install llvm

llvm 是已经安装了的,并且lsp可以连接到,但是只能补全 但是到nox这里就不行了,很奇怪

$ which clangd
/d/Program Files/LLVM/bin/clangd

那就不清楚了,我就是这样配置就可以正常用了。你的配置是怎么样的啊?

就是您的配置呀:

;; this is nox cofig
;;; Require
(add-to-list 'load-path (expand-file-name "e:/gitrep/nox"))
(require 'xref)
;;; Code:
(dolist (hook (list
               'js-mode-hook
               'rust-mode-hook
               'python-mode-hook
               'ruby-mode-hook
               'java-mode-hook
               'sh-mode-hook
               'php-mode-hook
               'c-mode-common-hook
               'c-mode-hook
               'c++-mode-hook
               'haskell-mode-hook
               'swift-mode-hook
               ))
  (add-hook hook '(lambda ()
                    (require 'nox)
                    (add-to-list 'nox-server-programs
                                 '((c++-mode c-mode) "clangd"))
                    (nox-ensure))))
(if (eq system-type 'windows-nt)
    (setq nox-python-path "E:/anaconda3/python.exe"))



(lazy-load-set-keys
 '(
   ("j" . xref-next-line)
   ("k" . xref-prev-line)
   )
 xref--xref-buffer-mode-map
 )
(provide 'init-nox)

看不出什么大的问题。Lazy-load 这个包如果你没用的话,就用其他方式绑定按键。没用的hook可以删除。

谢谢了,我也查不出什么问题,只能暂时放一放了,先用tabnine撑一撑了

太奇怪了,用scoop的emacs 就没这个问题,而用emaxpd和自己编译的就有问题,可能是某个选项没有编译进去?