lsp-pyright icon indicating copy to clipboard operation
lsp-pyright copied to clipboard

wrong-type-argument hash-table-p on pyright startup

Open albertodonato opened this issue 1 year ago • 5 comments

I'm getting this error whenever lsp is started on a python buffer:

Error processing message (wrong-type-argument hash-table-p (:jsonrpc "2.0" :method "window/logMessage" :params (:type 3 :message "Pyright language server 1.1.258 starting"))).
Error processing message (wrong-type-argument hash-table-p (:jsonrpc "2.0" :method "window/logMessage" :params (:type 3 :message "Server root directory: /snap/pyright/337/lib/node_modules/pyright/dist/"))).
Error processing message (wrong-type-argument hash-table-p (:jsonrpc "2.0" :id 1 :result (:capabilities (:textDocumentSync 2 :definitionProvider (:workDoneProgress t) :declarationProvider (:workDoneProgress t) :typeDefinitionProvider (:workDoneProgress t) :referencesProvider (:workDoneProgress t) :documentSymbolProvider (:workDoneProgress t) :workspaceSymbolProvider (:workDoneProgress t) :hoverProvider (:workDoneProgress t) :documentHighlightProvider (:workDoneProgress t) :renameProvider (:prepareProvider t :workDoneProgress t) :completionProvider (:triggerCharacters ["." "["] :resolveProvider t :workDoneProgress t :completionItem (:labelDetailsSupport t)) :signatureHelpProvider (:triggerCharacters ["(" "," ")"] :workDoneProgress t) :codeActionProvider (:codeActionKinds ["quickfix" "source.organizeImports"] :workDoneProgress t) :executeCommandProvider (:commands [] :workDoneProgress t) :callHierarchyProvider t)))).

the pyright process is running correctly, but communication doesn't seem to work.

I've tried wiping and reinstalling all packages (including wiping all .elc files), with no change.

albertodonato avatar Jul 15 '22 06:07 albertodonato

Turns out the issue is caused by having lsp-use-plists set to t (as suggested by https://emacs-lsp.github.io/lsp-mode/page/performance/#use-plists-for-deserialization). Is this perhaps some missing support in lsp-pyright?

albertodonato avatar Jul 15 '22 06:07 albertodonato

Faced same issue trying to improve lsp-mode performance on huge project

jumper047 avatar Dec 14 '22 11:12 jumper047

Turns out the issue is caused by having lsp-use-plists set to t (as suggested by https://emacs-lsp.github.io/lsp-mode/page/performance/#use-plists-for-deserialization). Is this perhaps some missing support in lsp-pyright?

I met same issue, and fixed it by this https://github.com/emacs-lsp/lsp-mode/issues/1036

luyajun01 avatar Feb 10 '23 06:02 luyajun01

So you have it working with pyright? I deleted all elc and eln files and still had the issue.

noctuid avatar Feb 10 '23 14:02 noctuid

So you have it working with pyright? I deleted all elc and eln files and still had the issue.

yeah,it worked. This problem has really troubled me for a long time, but it has indeed been solved.

If the above method does not work, you can also try the method mentioned by albertodonato

(setq lsp-use-plists nil)

luyajun01 avatar Feb 10 '23 14:02 luyajun01