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

Use jsx transformations in emmet

上级 d4bbcc63
......@@ -20,11 +20,13 @@ export function wrapWithAbbreviation() {
rangeToReplace = new vscode.Range(rangeToReplace.start.line, 0, rangeToReplace.start.line, editor.document.lineAt(rangeToReplace.start.line).text.length);
}
let textToReplace = editor.document.getText(rangeToReplace);
let syntax = getSyntax(editor.document);
let options = {
field: field,
syntax: getSyntax(editor.document),
syntax: syntax,
profile: getProfile(getSyntax(editor.document)),
text: textToReplace
text: textToReplace,
addons: syntax === 'jsx' ? { 'jsx': syntax === 'jsx' } : null
};
vscode.window.showInputBox({ prompt: 'Enter Abbreviation' }).then(abbr => {
......@@ -45,11 +47,12 @@ export function expandAbbreviation() {
if (rangeToReplace.isEmpty) {
[rangeToReplace, abbr] = extractAbbreviation(rangeToReplace.start);
}
let syntax = getSyntax(editor.document);
let options = {
field: field,
syntax: getSyntax(editor.document),
profile: getProfile(getSyntax(editor.document))
syntax: syntax,
profile: getProfile(getSyntax(editor.document)),
addons: syntax === 'jsx' ? { 'jsx': true } : null
};
let expandedText = expand(abbr, options);
......
......@@ -40,7 +40,8 @@ function getExpandedAbbreviation(document: vscode.TextDocument, position: vscode
let expandedWord = expand(wordToExpand, {
field: field,
syntax: syntax,
profile: getProfile(syntax)
profile: getProfile(syntax),
addons: syntax === 'jsx' ? { 'jsx': true } : null
});
let completionitem = new vscode.CompletionItem(wordToExpand);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册