Skip to content

CompletionItem data is not preserved between onCompletion and resolve if 0 #351

Closed

Description

@Gama11

CompletionItem.data is supposed to be preserved between the textDocument/completion and completionItem/resolve requests, but if its value is 0, this is not the case:

I modified the lsp-sample to demonstrate the problem (tested with vscode-languageclient 4.1.3):

This should either be fixed or at least be documented appropriately. For now this can be worked around by creating a wrapper object (data: {index: 0}).


Background: in the Haxe Language Server, we ran into an issue where after implementing completionItem/resolve, the first item in the list didn't show any documentation and threw an error regarding data being undefined in the output channel. We were using data to store the index the item had when it's returned to us from the Haxe compiler, so we can request more info on that item in resolve.

Activity

  1. dbaeumer commented on May 22, 2018

    @dbaeumer
    Member

    Good catch.

  2. added 2 commits that reference this issue on May 22, 2018
  3. added a commit that references this issue on May 22, 2018
  4. locked and limited conversation to collaborators on Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions