From d230b55cccae386f0fc3f6251217543f8de8565f Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Thu, 20 Jul 2017 10:25:46 -0700 Subject: [PATCH] Support expansion of commonly used html tags --- src/emmetHelper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emmetHelper.ts b/src/emmetHelper.ts index f45c9ec..624d25a 100644 --- a/src/emmetHelper.ts +++ b/src/emmetHelper.ts @@ -16,6 +16,7 @@ const htmlAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.]/; const htmlAbbreviationEndRegex = /[a-z,A-Z,!,),\],#,\.,},\d,*,$]$/; const cssAbbreviationRegex = /^[a-z,A-Z,!,@,#]/; const emmetModes = ['html', 'pug', 'slim', 'haml', 'xml', 'xsl', 'jsx', 'css', 'scss', 'sass', 'less', 'stylus']; +const commonlyUsedTags = ['div', 'span', 'p', 'b', 'i', 'body', 'html', 'ul', 'ol', 'li', 'head', 'script']; export interface EmmetConfiguration { useNewEmmet: string; @@ -46,7 +47,7 @@ export function doComplete(document: TextDocument, position: Position, syntax: s if (isAbbreviationValid(syntax, abbreviation)) { let expandedText; // Skip cases where abc -> ${1} as this is noise - if (isStyleSheet(syntax) || !/^[a-z,A-Z]*$/.test(abbreviation) || htmlSnippetKeys.indexOf(abbreviation) > -1) { + if (isStyleSheet(syntax) || !/^[a-z,A-Z]*$/.test(abbreviation) || htmlSnippetKeys.indexOf(abbreviation) > -1 || commonlyUsedTags.indexOf(abbreviation) > -1) { try { expandedText = expand(abbreviation, expandOptions); // Skip cases when abc -> abc: ; as this is noise