Invalid params for initialize ":codeAction/resolve"
archer-n opened this issue · comments
archer-n commented
I tried the solution and it worked, write at the end
- Server used: dart language-server
- Emacs version: GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-07-12 (commit: 04710bd01b2)
- Operating system: Arch Linux
- Eglot version: 3b7273f4ae3 Eglot: add support for :codeAction/resolve
- Eglot installation method: build-in
- Using Doom: No
LSP transcript - M-x eglot-events-buffer (mandatory unless Emacs inoperable)
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 71964 :clientInfo (:name "Eglot") :rootPath
"/home/archer/workspace/android/foo/"
:rootUri
"file:///home/archer/workspace/android/foo"
:initializationOptions
#s(hash-table size 1 test eql rehash-size 1.5
rehash-threshold 0.8125 data ())
:capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
:workspaceEdit (:documentChanges t)
:didChangeWatchedFiles
(:dynamicRegistration t) :symbol
(:dynamicRegistration :json-false)
:configuration t :workspaceFolders
t)
:textDocument
(:synchronization
(:dynamicRegistration :json-false :willSave t
:willSaveWaitUntil t
:didSave t)
:completion
(:dynamicRegistration :json-false
:completionItem
(:snippetSupport t
:deprecatedSupport
t
:resolveSupport
(:properties
["documentation"
"details"
"additionalTextEdits"])
:tagSupport
(:valueSet
[1]))
:contextSupport t)
:hover
(:dynamicRegistration :json-false
:contentFormat
["markdown" "plaintext"])
:signatureHelp
(:dynamicRegistration :json-false
:signatureInformation
(:parameterInformation
(:labelOffsetSupport t)
:documentationFormat
["markdown" "plaintext"]
:activeParameterSupport
t))
:references (:dynamicRegistration :json-false)
:definition
(:dynamicRegistration :json-false :linkSupport
t)
:declaration
(:dynamicRegistration :json-false :linkSupport
t)
:implementation
(:dynamicRegistration :json-false :linkSupport
t)
:typeDefinition
(:dynamicRegistration :json-false :linkSupport
t)
:documentSymbol
(:dynamicRegistration :json-false
:hierarchicalDocumentSymbolSupport
t :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]))
:documentHighlight
(:dynamicRegistration :json-false) :codeAction
(:dynamicRegistration :json-false
:resolveSupport t
:dataSupport t
:codeActionLiteralSupport
(:codeActionKind
(:valueSet
["quickfix" "refactor"
"refactor.extract"
"refactor.inline"
"refactor.rewrite"
"source"
"source.organizeImports"]))
:isPreferredSupport t)
:formatting (:dynamicRegistration :json-false)
:rangeFormatting
(:dynamicRegistration :json-false) :rename
(:dynamicRegistration :json-false) :inlayHint
(:dynamicRegistration :json-false)
:publishDiagnostics
(:relatedInformation :json-false
:codeDescriptionSupport
:json-false :tagSupport
(:valueSet [1 2])))
:window
(:showDocument (:support t) :workDoneProgress t)
:general
(:positionEncodings ["utf-32" "utf-8" "utf-16"])
:experimental
#s(hash-table size 1 test eql rehash-size 1.5
rehash-threshold 0.8125 data ()))
:workspaceFolders
[(:uri
"file:///home/archer/workspace/android/foo"
:name "~/workspace/android/foo/")]))
(:id 1 :jsonrpc "2.0" :error
(:code -32602 :message
"Invalid params for initialize:\nparams.capabilities.textDocument.codeAction.resolveSupport must be of type CodeActionClientCapabilitiesResolveSupport"))
Backtrace (mandatory, unless no error message seen or heard):
Not possible to provide
Minimum Reproducible Example (mandatory)
- I start Emacs GUI
- I downloaded the latest dart sdk(Dart SDK version: 2.19.6 (stable) (Tue Mar 28 13:41:04 2023 +0000) on "linux_x64") executable
- I can reproduce on any Dart file or repository
Tried the solution, it's worked
-
After reading the lsp document, I found that the data format is incorrect
-
After modifying the source code, rebuild emacs, Below is my modification:
:codeAction (list
:dynamicRegistration :json-false
- :resolveSupport t :dataSupport t
+ :resolveSupport `(:properties ["edit"])
+ :dataSupport t
:codeActionLiteralSupport
João Távora commented