mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
move insert/replace range API to proposed
This commit is contained in:
parent
ec6d344197
commit
fcb807c75f
12
src/vs/vscode.d.ts
vendored
12
src/vs/vscode.d.ts
vendored
|
@ -3393,17 +3393,15 @@ declare module 'vscode' {
|
|||
insertText?: string | SnippetString;
|
||||
|
||||
/**
|
||||
* A range or a insert and replace range selecting the text that should be replaced by this completion item.
|
||||
* A range of text that should be replaced by this completion item.
|
||||
*
|
||||
* When omitted, the range of the [current word](#TextDocument.getWordRangeAtPosition) is used as replace-range
|
||||
* and as insert-range the start of the [current word](#TextDocument.getWordRangeAtPosition) to the
|
||||
* current position is used.
|
||||
* Defaults to a range from the start of the [current word](#TextDocument.getWordRangeAtPosition) to the
|
||||
* current position.
|
||||
*
|
||||
* *Note 1:* A range must be a [single line](#Range.isSingleLine) and it must
|
||||
* *Note:* The range must be a [single line](#Range.isSingleLine) and it must
|
||||
* [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems).
|
||||
* *Note 2:* A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.
|
||||
*/
|
||||
range?: Range | { insert: Range; replace: Range; };
|
||||
range?: Range;
|
||||
|
||||
/**
|
||||
* An optional set of characters that when pressed while this completion is active will accept it first and
|
||||
|
|
20
src/vs/vscode.proposed.d.ts
vendored
20
src/vs/vscode.proposed.d.ts
vendored
|
@ -997,4 +997,24 @@ declare module 'vscode' {
|
|||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region joh, insert/replace completions: https://github.com/microsoft/vscode/issues/10266
|
||||
|
||||
export interface CompletionItem {
|
||||
|
||||
/**
|
||||
* A range or a insert and replace range selecting the text that should be replaced by this completion item.
|
||||
*
|
||||
* When omitted, the range of the [current word](#TextDocument.getWordRangeAtPosition) is used as replace-range
|
||||
* and as insert-range the start of the [current word](#TextDocument.getWordRangeAtPosition) to the
|
||||
* current position is used.
|
||||
*
|
||||
* *Note 1:* A range must be a [single line](#Range.isSingleLine) and it must
|
||||
* [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems).
|
||||
* *Note 2:* A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.
|
||||
*/
|
||||
range2?: Range | { insert: Range; replace: Range; };
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
|
|
|
@ -756,6 +756,8 @@ class SuggestAdapter {
|
|||
range = item.textEdit.range;
|
||||
} else if (item.range) {
|
||||
range = item.range;
|
||||
} else if (item.range2) {
|
||||
range = item.range2;
|
||||
}
|
||||
|
||||
if (range) {
|
||||
|
|
|
@ -1343,7 +1343,8 @@ export class CompletionItem implements vscode.CompletionItem {
|
|||
preselect?: boolean;
|
||||
insertText?: string | SnippetString;
|
||||
keepWhitespace?: boolean;
|
||||
range?: Range | { insert: Range; replace: Range; };
|
||||
range?: Range;
|
||||
range2?: Range | { insert: Range; replace: Range; };
|
||||
commitCharacters?: string[];
|
||||
textEdit?: TextEdit;
|
||||
additionalTextEdits?: TextEdit[];
|
||||
|
|
Loading…
Reference in a new issue