Emmet suggestions for jsx only when expicitly asked for #29532

This commit is contained in:
Ramya Achutha Rao
2017-06-28 14:39:44 -07:00
parent 082ccc4848
commit 04f25df845
3 changed files with 8 additions and 4 deletions

View File

@@ -40,8 +40,8 @@
},
"emmet.includeLanguages": {
"type": "object",
"default": {},
"description": "Enable emmet abbreviations in languages that are not supported by default. Add a mapping here between the language and emmet supported syntax.\n Eg: {\"php\": \"html\"}"
"default": {},
"description": "Enable emmet abbreviations in languages that are not supported by default. Add a mapping here between the language and emmet supported language.\n Eg: {\"php\": \"html\", \"javascript\": \"javascriptreact\"}"
},
"emmet.variables":{
"type": "object",

View File

@@ -26,7 +26,9 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
syntax = this.syntaxHelper(syntax, document, position);
}
if (!syntax || (isSyntaxMapped && vscode.workspace.getConfiguration('emmet')['showExpandedAbbreviation'] !== 'always')) {
if (!syntax
|| ((isSyntaxMapped || syntax === 'jsx')
&& vscode.workspace.getConfiguration('emmet')['showExpandedAbbreviation'] !== 'always')) {
return;
}

View File

@@ -20,7 +20,9 @@ export const LANGUAGE_MODES: Object = {
'scss': [':'],
'sass': [':'],
'less': [':'],
'stylus': [':']
'stylus': [':'],
'javascriptreact': ['.', '}'],
'typescriptreact': ['.', '}']
};
// Explicitly map languages to their parent language to get emmet completion support