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

[monaco] fix Microsoft/monaco-editor#642: sync CompletionItemProvider api #41595

Merged
merged 1 commit into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/vs/editor/standalone/browser/standaloneLanguages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,18 @@ export interface CompletionItem {
* line completions were [requested](#CompletionItemProvider.provideCompletionItems) at.~~
*/
textEdit?: model.ISingleEditOperation;
/**
* An optional array of additional text edits that are applied when
* selecting this completion. Edits must not overlap with the main edit
* nor with themselves.
*/
additionalTextEdits?: model.ISingleEditOperation[];
/**
* An optional set of characters that when pressed while this completion is active will accept it first and
* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
* characters will be ignored.
*/
commitCharacters?: string[];
}
/**
* Represents a collection of [completion items](#CompletionItem) to be presented
Expand Down Expand Up @@ -634,7 +646,9 @@ class SuggestAdapter {
command: item.command,
sortText: item.sortText,
filterText: item.filterText,
snippetType: 'internal'
snippetType: 'internal',
additionalTextEdits: item.additionalTextEdits,
commitCharacters: item.commitCharacters
};
let editRange = item.textEdit ? item.textEdit.range : item.range;
if (editRange) {
Expand Down
12 changes: 12 additions & 0 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4166,6 +4166,18 @@ declare module monaco.languages {
* line completions were [requested](#CompletionItemProvider.provideCompletionItems) at.~~
*/
textEdit?: editor.ISingleEditOperation;
/**
* An optional array of additional text edits that are applied when
* selecting this completion. Edits must not overlap with the main edit
* nor with themselves.
*/
additionalTextEdits?: editor.ISingleEditOperation[];
/**
* An optional set of characters that when pressed while this completion is active will accept it first and
* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
* characters will be ignored.
*/
commitCharacters?: string[];
}

/**
Expand Down