[html] enable handlebars

This commit is contained in:
Martin Aeschlimann
2016-09-14 11:11:45 +02:00
parent fa30ab77ef
commit b66b9871a0
5 changed files with 49 additions and 4 deletions

View File

@@ -62,4 +62,19 @@ export function activate(context: ExtensionContext) {
}
],
});
languages.setLanguageConfiguration('handlebars', {
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|('(?:[^\\\']*(?:\\.)?)*'?)|[^\s<>={}\[\],]+/,
onEnterRules:[
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
action: { indentAction: IndentAction.IndentOutdent }
},
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
action: { indentAction: IndentAction.Indent }
}
],
});
}