mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Fix emmet issue when cursor is in between the abbreviation
This commit is contained in:
@@ -33,19 +33,20 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
|
||||
|
||||
let result: vscode.CompletionList = doComplete(document, position, syntax, getEmmetConfiguration());
|
||||
let newItems: vscode.CompletionItem[] = [];
|
||||
result.items.forEach(item => {
|
||||
let newItem = new vscode.CompletionItem(item.label);
|
||||
newItem.documentation = item.documentation;
|
||||
newItem.detail = item.detail;
|
||||
newItem.insertText = new vscode.SnippetString(item.textEdit.newText);
|
||||
let oldrange = item.textEdit.range;
|
||||
newItem.range = new vscode.Range(oldrange.start.line, oldrange.start.character, oldrange.end.line, oldrange.end.character);
|
||||
|
||||
newItem.filterText = item.filterText;
|
||||
newItem.sortText = item.sortText;
|
||||
newItems.push(newItem);
|
||||
});
|
||||
if (result.items) {
|
||||
result.items.forEach(item => {
|
||||
let newItem = new vscode.CompletionItem(item.label);
|
||||
newItem.documentation = item.documentation;
|
||||
newItem.detail = item.detail;
|
||||
newItem.insertText = new vscode.SnippetString(item.textEdit.newText);
|
||||
let oldrange = item.textEdit.range;
|
||||
newItem.range = new vscode.Range(oldrange.start.line, oldrange.start.character, oldrange.end.line, oldrange.end.character);
|
||||
|
||||
newItem.filterText = item.filterText;
|
||||
newItem.sortText = item.sortText;
|
||||
newItems.push(newItem);
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(new vscode.CompletionList(newItems, true));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user