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

What is the logic for multiple suggestion api? (multiple autocomplete extensions) #139193

Closed
softmarshmallow opened this issue Dec 15, 2021 · 2 comments
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@softmarshmallow
Copy link

I'm planning to develop a suggestion extension something like github copilot, but more focused on front-end code.

What happens if user has multiple extensions doing the suggestion? can i force vscode to suggest my code first?
What is the priority and how is it handled?

@jrieken
Copy link
Member

jrieken commented Dec 15, 2021

see

vscode/src/vscode-dts/vscode.d.ts

Lines 11436 to 11441 in ab80dae

* Multiple providers can be registered for a language. In that case providers are sorted
* by their {@link languages.match score} and groups of equal score are sequentially asked for
* completion items. The process stops when one or many providers of a group return a
* result. A failing provider (rejected promise or exception) will not fail the whole
* operation.
*

@jrieken
Copy link
Member

jrieken commented Dec 15, 2021

and

/**
* A string that should be used when comparing this item
* with other items. When `falsy` the {@link CompletionItem.label label}
* is used.
*
* Note that `sortText` is only used for the initial ordering of completion
* items. When having a leading word (prefix) ordering is based on how
* well completions match that prefix and the initial ordering is only used
* when completions match equally well. The prefix is defined by the
* {@linkcode CompletionItem.range range}-property and can therefore be different
* for each completion.
*/
sortText?: string;

@jrieken jrieken closed this as completed Dec 15, 2021
@jrieken jrieken added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Dec 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants