emacs-lsp / lsp-pyright

lsp-mode :heart: pyright
https://emacs-lsp.github.io/lsp-pyright
GNU General Public License v3.0
284 stars 24 forks source link

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

Open albertodonato opened 2 years ago

albertodonato commented 2 years ago

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 commented 2 years ago

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?

jumper047 commented 1 year ago

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

luyajun01 commented 1 year ago

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

noctuid commented 1 year ago

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

luyajun01 commented 1 year ago

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)