Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request 'completionItem/resolve' did not return range in textEdit field #1373

Closed
archer-n opened this issue Jun 1, 2022 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@archer-n
Copy link

archer-n commented Jun 1, 2022

Version in use: @volar/vue-language-server@0.35.2

My client doesn't declare support for "textDocument.completion.completionItem.insertReplaceSupport", but is returning InsertReplaceEdit objects.

Here is my init request:

(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId 27899 :rootPath "/home/archer/workspace/web/lanjiang-admin/" :rootUri "file:///home/archer/workspace/web/lanjiang-admin" :initializationOptions
                      (:typescript
                       (:serverPath "/home/archer/.nvm/versions/node/v16.14.2/lib/node_modules/typescript/lib/tsserverlibrary.js")
                       :languageFeatures
                       (:references t :implementation t :definition t :typeDefinition t :rename t :renameFileRefactoring t :signatureHelp t :codeAction t :workspaceSymbol t :completion
                                    (:defaultTagNameCase "" :defaultAttrNameCase "" :getDocumentNameCasesRequest :json-false :getDocumentSelectionRequest :json-false)
                                    :schemaRequestService
                                    (:getDocumentContentRequest :json-false))
                       :documentFeatures
                       (:selectionRange t :foldingRange :json-false :linkedEditingRange t :documentSymbol t :documentColor t :documentFormatting
                                        (:defaultPrintWidth 100 :getDocumentPrintWidthRequest :json-false)
                                        :defaultPrintWidth 100 :getDocumentPrintWidthRequest :json-false))
                      :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 :tagSupport
                                                               (:valueSet
                                                                [1]))
                                              :contextSupport t)
                        :hover
                        (:dynamicRegistration :json-false :contentFormat
                                              ["markdown" "plaintext"])
                        :signatureHelp
                        (:dynamicRegistration :json-false :signatureInformation
                                              (:parameterInformation
                                               (:labelOffsetSupport t)
                                               :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 :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)
                        :publishDiagnostics
                        (:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
                                             (:valueSet
                                              [1 2])))
                       :experimental #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                   ()))
                      :workspaceFolders
                      [(:uri "file:///home/archer/workspace/web/lanjiang-admin" :name "~/workspace/web/lanjiang-admin/")]))

The 'completionItem/resolve' request log is as follows:

[client-request] (id:7) Wed Jun  1 17:01:20 2022:
(:jsonrpc "2.0" :id 7 :method "completionItem/resolve" :params
          (:label
           #("Array" 0 1
             (eglot--lsp-item #1))
           :kind 6 :sortText "15" :commitCharacters
           ["." "," ";" "("]
           :insertTextFormat 1 :textEdit
           (:range
            (:start
             (:line 49 :character 0)
             :end
             (:line 49 :character 3))
            :newText "Array")
           :data
           (:uri "file:///home/archer/workspace/web/lanjiang-admin/src/components/Login.vue" :originalItem
                 (:label "Array" :kind 6 :sortText "15" :commitCharacters
                         ["." "," ";" "("]
                         :insertTextFormat 1 :textEdit
                         (:newText "Array" :insert
                                   (:start
                                    (:line 17 :character 0)
                                    :end
                                    (:line 17 :character 3))
                                   :replace
                                   (:start
                                    (:line 17 :character 0)
                                    :end
                                    (:line 17 :character 3)))
                         :data
                         (:uri "file:///home/archer/workspace/web/lanjiang-admin/src/components/Login.vue.ts" :fileName "/home/archer/workspace/web/lanjiang-admin/src/components/Login.vue.ts" :offset 393 :originalItem
                               (:name "Array" :kind "var" :kindModifiers "declare" :sortText "15")))
                 :pluginId 12 :sourceMap
                 (:embeddedDocumentUri "file:///home/archer/workspace/web/lanjiang-admin/src/components/Login.vue.ts"))))

[server-reply] (id:7) Wed Jun  1 17:01:20 2022:
(:jsonrpc "2.0" :id 7 :result
          (:label "Array" :kind 6 :sortText "15" :commitCharacters
                  ["." "," ";" "("]
                  :insertTextFormat 1 :textEdit
                  (:newText "Array" :insert
                            (:start
                             (:line 49 :character 0)
                             :end
                             (:line 49 :character 3))
                            :replace
                            (:start
                             (:line 49 :character 0)
                             :end
                             (:line 49 :character 3)))
                  :data
                  (:uri "file:///home/archer/workspace/web/lanjiang-admin/src/components/Login.vue.ts" :fileName "/home/archer/workspace/web/lanjiang-admin/src/components/Login.vue.ts" :offset 393 :originalItem
                        (:name "Array" :kind "var" :kindModifiers "declare" :sortText "15"))
                  :detail "interface Array<T>\nvar Array: ArrayConstructor" :documentation
                  (:kind "markdown" :value "")))
@johnsoncodehk johnsoncodehk added the bug Something isn't working label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants