各位好,最近在windows 10系统下开发公司的代码,遇到如下问题:
环境:scoop安装的emacs27.1
, doom
, ccls + lsp-mode
,看代码目前还比较正常,在编辑代码输入文本企图补全时,minibuffer
会弹出来如下内容:
Warning (lsp-mode): Failed to parse the following chunk:
’’’
Content-Length: 27276
[jsonrpc信息,太长了无法发出来]
’’’
with message (json-parse-error unable to decode byte 0xb0 near '"19-CPLD' <string> 1 401 401)
[其他类似的错误信息]
貌似是因为某些gb2312编码引发的问题。
打开toggle-debug-on-error
,错误信息如下:
Debugger entered--Lisp error: (wrong-type-argument hash-table-p t)
gethash("params" t)
lsp--on-notification(#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/22 0x3586be9> :registered-server-capabilities (#s(lsp--registered-capability :id "didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x35a7239>)) :root "z:/code/GeneralDvr" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x34ec249>) :test\? #f(compiled-function () #<bytecode 0x34ec261>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x34ec26d> :request-handlers #<hash-table equal 0/65 0x34ec49d> :response-handlers #<hash-table eql 1/65 0x34ed039> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x34ed059> :action-handlers #<hash-table equal 0/65 0x34ed49d> :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 0x34eaac1>) :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 0x34edca5> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process ccls> :cmd-proc #<process ccls> :buffers (#<buffer cpc_net.c>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x320d71d> :watches #<hash-table equal 0/65 0x320bde1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 1/65 0x320c011> :work-done-tokens #<hash-table equal 0/65 0x320c031>) t)
lsp--parser-on-message(t #s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/22 0x3586be9> :registered-server-capabilities (#s(lsp--registered-capability :id "didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x35a7239>)) :root "z:/code/GeneralDvr" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x34ec249>) :test\? #f(compiled-function () #<bytecode 0x34ec261>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x34ec26d> :request-handlers #<hash-table equal 0/65 0x34ec49d> :response-handlers #<hash-table eql 1/65 0x34ed039> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x34ed059> :action-handlers #<hash-table equal 0/65 0x34ed49d> :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 0x34eaac1>) :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 0x34edca5> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process ccls> :cmd-proc #<process ccls> :buffers (#<buffer cpc_net.c>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x320d71d> :watches #<hash-table equal 0/65 0x320bde1> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 1/65 0x320c011> :work-done-tokens #<hash-table equal 0/65 0x320c031>))
#f(compiled-function (proc input) #<bytecode 0x320c081>)(#<process ccls> "Content-Length: 27276\15\n\15\n{\"jsonrpc\":\"2.0\",\"id\":280...")
accept-process-output(nil 0.001)
lsp-request-while-no-input("textDocument/completion" (:textDocument (:uri "file:///z%3A/code/GeneralDvr/src/cpc_module/src/in...") :position (:line 214 :character 6) :context #<hash-table equal 1/65 0x31dee2d>))
#f(compiled-function () #<bytecode 0x31dc85d>)()
#f(compiled-function (probe pred action) #<bytecode 0x31dc7f9>)("cp" nil t)
all-completions("cp" #f(compiled-function (probe pred action) #<bytecode 0x31dc7f9>) nil)
completion-pcm--all-completions("" ("cp" point) #f(compiled-function (probe pred action) #<bytecode 0x31dc7f9>) nil)
completion-basic-all-completions("cp" #f(compiled-function (probe pred action) #<bytecode 0x31dc7f9>) nil 2)
#f(compiled-function (style) #<bytecode 0x31db7e5>)(basic)
completion--some(#f(compiled-function (style) #<bytecode 0x31db7e5>) (basic partial-completion emacs22))
completion--nth-completion(2 "cp" #f(compiled-function (probe pred action) #<bytecode 0x31dc7f9>) nil 2 (metadata (category . lsp-capf) (display-sort-function . identity)))
completion-all-completions("cp" #f(compiled-function (probe pred action) #<bytecode 0x31dc7f9>) nil 2 (metadata (category . lsp-capf) (display-sort-function . identity)))
company-capf--candidates("cp")
company-capf(candidates "cp")
apply(company-capf (candidates "cp"))
company-call-backend-raw(candidates "cp")
company--fetch-candidates("cp")
company-calculate-candidates("cp" nil)
company--begin-new()
company--perform()
company-auto-begin()
company-idle-begin(#<buffer cpc_net.c> #<window 3 on cpc_net.c> 3427 6998)
apply(company-idle-begin (#<buffer cpc_net.c> #<window 3 on cpc_net.c> 3427 6998))
timer-event-handler([t 24507 5067 989536 nil company-idle-begin (#<buffer cpc_net.c> #<window 3 on cpc_net.c> 3427 6998) nil 0])
请问是否有人遇到过类似问题?或者有什么高招能够规避?