mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 12:40:19 -05:00
todo update
This commit is contained in:
@@ -1594,7 +1594,10 @@ export class CompletionList {
|
||||
|
||||
@es5ClassCompat
|
||||
export class InlineSuggestion implements vscode.InlineCompletionItem {
|
||||
insertText?: string;
|
||||
|
||||
insertText?: string | SnippetString;
|
||||
|
||||
filterText?: string;
|
||||
|
||||
/**
|
||||
* @deprecated Use `insertText` instead. Will be removed eventually.
|
||||
@@ -1604,7 +1607,7 @@ export class InlineSuggestion implements vscode.InlineCompletionItem {
|
||||
range?: Range;
|
||||
command?: vscode.Command;
|
||||
|
||||
constructor(insertText: string, range?: Range, command?: vscode.Command) {
|
||||
constructor(insertText: string | SnippetString, range?: Range, command?: vscode.Command) {
|
||||
this.insertText = insertText;
|
||||
this.range = range;
|
||||
this.command = command;
|
||||
|
||||
@@ -9,16 +9,24 @@ declare module 'vscode' {
|
||||
// Temporary API to allow for safe migration.
|
||||
|
||||
export namespace languages {
|
||||
|
||||
/**
|
||||
* Registers an inline completion provider.
|
||||
*
|
||||
* @return A {@link Disposable} that unregisters this provider when being disposed.
|
||||
* Multiple providers can be registered for a language. In that case providers are asked in
|
||||
* parallel and the results are merged. A failing provider (rejected promise or exception) will
|
||||
* not cause a failure of the whole operation.
|
||||
*
|
||||
* @param selector A selector that defines the documents this provider is applicable to.
|
||||
* @param provider A inline completion provider.
|
||||
* @return A {@link Disposable} that unregisters this provider when being disposed.
|
||||
*/
|
||||
// TODO@API what are the rules when multiple providers apply
|
||||
export function registerInlineCompletionItemProviderNew(selector: DocumentSelector, provider: InlineCompletionItemProviderNew): Disposable;
|
||||
}
|
||||
|
||||
// TODO@API doc
|
||||
export interface InlineCompletionItemProviderNew {
|
||||
|
||||
/**
|
||||
* Provides inline completion items for the given position and document.
|
||||
* If inline completions are enabled, this method will be called whenever the user stopped typing.
|
||||
@@ -28,6 +36,7 @@ declare module 'vscode' {
|
||||
provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContextNew, token: CancellationToken): ProviderResult<InlineCompletionListNew | InlineCompletionItemNew[]>;
|
||||
}
|
||||
|
||||
// TODO@API doc
|
||||
export interface InlineCompletionContextNew {
|
||||
/**
|
||||
* How the completion was triggered.
|
||||
@@ -50,6 +59,7 @@ declare module 'vscode' {
|
||||
}
|
||||
|
||||
// TODO@API find a better name, xyzFilter, xyzConstraint
|
||||
// TODO@API doc
|
||||
export interface SelectedCompletionInfoNew {
|
||||
range: Range;
|
||||
text: string;
|
||||
@@ -126,7 +136,7 @@ declare module 'vscode' {
|
||||
*/
|
||||
command?: Command;
|
||||
|
||||
// TODO@API insertText -> string | SnippetString
|
||||
constructor(insertText: string, range?: Range, command?: Command);
|
||||
// TODO@API doc
|
||||
constructor(insertText: string | SnippetString, range?: Range, command?: Command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user