Skip to content

Commit 04f25df

Browse files
committed
Emmet suggestions for jsx only when expicitly asked for microsoft#29532
1 parent 082ccc4 commit 04f25df

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

extensions/emmet/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
},
4141
"emmet.includeLanguages": {
4242
"type": "object",
43-
"default": {},
44-
"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\"}"
43+
"default": {},
44+
"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\"}"
4545
},
4646
"emmet.variables":{
4747
"type": "object",

extensions/emmet/src/defaultCompletionProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi
2626
syntax = this.syntaxHelper(syntax, document, position);
2727
}
2828

29-
if (!syntax || (isSyntaxMapped && vscode.workspace.getConfiguration('emmet')['showExpandedAbbreviation'] !== 'always')) {
29+
if (!syntax
30+
|| ((isSyntaxMapped || syntax === 'jsx')
31+
&& vscode.workspace.getConfiguration('emmet')['showExpandedAbbreviation'] !== 'always')) {
3032
return;
3133
}
3234

extensions/emmet/src/util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export const LANGUAGE_MODES: Object = {
2020
'scss': [':'],
2121
'sass': [':'],
2222
'less': [':'],
23-
'stylus': [':']
23+
'stylus': [':'],
24+
'javascriptreact': ['.', '}'],
25+
'typescriptreact': ['.', '}']
2426
};
2527

2628
// Explicitly map languages to their parent language to get emmet completion support

0 commit comments

Comments
 (0)