Skip to content

rankCompletionItems

rankCompletionItems(items, prefix): readonly CompletionItem[]

Filters and orders a completion list against what has been typed.

An item earns its place by where the typed characters landed in it, so a word start, a camel-case hump and the far side of a separator all outrank the same letters found in the middle of a word. Ties fall back to the server’s own sortText, which is how a server expresses relevance it knows and the client does not.

readonly CompletionItem[]

string

readonly CompletionItem[]