提交 fa413ff0 编写于 作者: R Ramya Achutha Rao

Move the checks on abbreviations to helper module

上级 747310ab
......@@ -38,9 +38,9 @@
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz"
},
"vscode-emmet-helper": {
"version": "1.0.12",
"from": "vscode-emmet-helper@>=1.0.12 <2.0.0",
"resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-1.0.12.tgz"
"version": "1.0.13",
"from": "vscode-emmet-helper@>=1.0.13 <2.0.0",
"resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-1.0.13.tgz"
},
"vscode-languageserver-types": {
"version": "3.3.0",
......
......@@ -212,7 +212,7 @@
"@emmetio/html-matcher": "^0.3.1",
"@emmetio/css-parser": "^0.4.0",
"@emmetio/math-expression": "^0.1.1",
"vscode-emmet-helper": "^1.0.12",
"vscode-emmet-helper": "^1.0.13",
"vscode-languageserver-types": "^3.0.3",
"image-size": "^0.5.2",
"vscode-nls": "2.0.2"
......
......@@ -134,17 +134,6 @@ export function expandEmmetAbbreviation(args): Thenable<boolean> {
}
}
// Dont try to expand abbreviations when cursor is before/after ; or : or in the middle of a word
// Fix for https://github.com/Microsoft/vscode/issues/1623 in new emmet
if (isStyleSheet(syntax) && !/\s!$/.test(textTillPosition)) {
const charAtPosition = currentLine.substr(position.character, 1);
if (textTillPosition.endsWith(':')
|| textTillPosition.endsWith(';')
|| (charAtPosition && !/\s/.test(charAtPosition))) {
return [null, '', []];
}
}
let extractedResults = extractAbbreviation(editor.document, position);
if (!extractedResults) {
return [null, '', []];
......
......@@ -33,7 +33,7 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
let result: vscode.CompletionList = doComplete(document, position, syntax, getEmmetConfiguration());
let newItems: vscode.CompletionItem[] = [];
if (result.items) {
if (result && result.items) {
result.items.forEach(item => {
let newItem = new vscode.CompletionItem(item.label);
newItem.documentation = item.documentation;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册