mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-20 12:00:24 -04:00
Merge from vscode 1ce89e2cb720d69c496c2815c4696ee4fd4429a6 (#6779)
* Merge from vscode 1ce89e2cb720d69c496c2815c4696ee4fd4429a6 * redisable accounts because of issues
This commit is contained in:
@@ -489,21 +489,18 @@ export class SnippetSession {
|
||||
return;
|
||||
}
|
||||
|
||||
const model = this._editor.getModel();
|
||||
|
||||
// make insert edit and start with first selections
|
||||
const { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, false, this._options.adjustWhitespace, this._options.clipboardText);
|
||||
this._snippets = snippets;
|
||||
|
||||
const selections = model.pushEditOperations(this._editor.getSelections(), edits, undoEdits => {
|
||||
this._editor.executeEdits('snippet', edits, undoEdits => {
|
||||
if (this._snippets[0].hasPlaceholder) {
|
||||
return this._move(true);
|
||||
} else {
|
||||
return undoEdits.map(edit => Selection.fromPositions(edit.range.getEndPosition()));
|
||||
}
|
||||
})!;
|
||||
this._editor.setSelections(selections);
|
||||
this._editor.revealRange(selections[0]);
|
||||
});
|
||||
this._editor.revealRange(this._editor.getSelections()[0]);
|
||||
}
|
||||
|
||||
merge(template: string, options: ISnippetSessionInsertOptions = _defaultOptions): void {
|
||||
@@ -513,8 +510,7 @@ export class SnippetSession {
|
||||
this._templateMerges.push([this._snippets[0]._nestingLevel, this._snippets[0]._placeholderGroupsIdx, template]);
|
||||
const { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, template, options.overwriteBefore, options.overwriteAfter, true, options.adjustWhitespace, options.clipboardText);
|
||||
|
||||
this._editor.setSelections(this._editor.getModel().pushEditOperations(this._editor.getSelections(), edits, undoEdits => {
|
||||
|
||||
this._editor.executeEdits('snippet', edits, undoEdits => {
|
||||
for (const snippet of this._snippets) {
|
||||
snippet.merge(snippets);
|
||||
}
|
||||
@@ -525,7 +521,7 @@ export class SnippetSession {
|
||||
} else {
|
||||
return undoEdits.map(edit => Selection.fromPositions(edit.range.getEndPosition()));
|
||||
}
|
||||
})!);
|
||||
});
|
||||
}
|
||||
|
||||
next(): void {
|
||||
|
||||
Reference in New Issue
Block a user