mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Snippet insertion extension API changes
- Basing snippet insertion failure on a new `_codeEditor` null-check. - Now returns `Thenable<boolean>`. - Removed vscode.proposed.d.ts copy of the `TextEditor` change. - Removing empty options interface.
This commit is contained in:
@@ -68,10 +68,6 @@ export interface IApplyEditsOptions extends IUndoStopOptions {
|
||||
setEndOfLine: EndOfLine;
|
||||
}
|
||||
|
||||
export interface IInsertSnippetOptions extends IUndoStopOptions {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Text Editor that is permanently bound to the same model.
|
||||
* It can be bound or not to a CodeEditor.
|
||||
@@ -392,9 +388,13 @@ export class MainThreadTextEditor {
|
||||
return false;
|
||||
}
|
||||
|
||||
insertSnippet(template: string, opts: IInsertSnippetOptions) {
|
||||
insertSnippet(template: string, opts: IUndoStopOptions) {
|
||||
const snippetController = SnippetController.get(this._codeEditor);
|
||||
|
||||
if (!this._codeEditor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this._codeEditor.focus();
|
||||
|
||||
if (opts.undoStopBefore) {
|
||||
@@ -406,6 +406,8 @@ export class MainThreadTextEditor {
|
||||
if (opts.undoStopAfter) {
|
||||
this._codeEditor.pushUndoStop();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user