Skip to content

Conversation

heavenshell
Copy link
Contributor

Hi,

I found vtslp and typescript-language-server complete invalid item.

Steps to reproduce

type Address = {
  state?: string
  town?: string
}

type Person = {
  name?: string
  age?: number
  address?: Address
}

const foo: Person = {
  name: 'foo',
  age: 20,                 
}

When I type like following

foo.address.<c-x><c-o>
            +--------------+
            | state? field |
            | town?  field |
            +--------------+

and select state?, text insert like following

foo.address.?.state

expected behavior is

foo.address?.state

According to the Language Server Protocol 3.17 specification:

  • filterText is only used for filtering and sorting completion items
  • When textEdit is provided, insertText must be ignored

In vim-lsp completion context, l:completion_item['filterText'] was set.
I think this is unnecessary.

I would appreciate it if someone could review this.

Before

Kapture.2025-08-10.17.11.10.mp4

After

Kapture.2025-08-10.17.38.26.mp4

According to the Language Server Protocol 3.17 specification:

- filterText is only used for filtering and sorting completion items
- When textEdit is provided, insertText must be ignored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant