I'd like emmet to help me with this:
const str = 'lorem5|TAB'; --> const str = 'Lorem ipsum dolor sit amet.';
|
cursor position
TAB
hitting tab
Is it possible in VSCode? It works for me only with jsx
and html
.
I'd like emmet to help me with this:
const str = 'lorem5|TAB'; --> const str = 'Lorem ipsum dolor sit amet.';
|
cursor position
TAB
hitting tab
Is it possible in VSCode? It works for me only with jsx
and html
.
You can but there are probably better ways to do this (such as dedicated extensions)
To use emmet, just enable emmet in *.js
files by setting:
"emmet.includeLanguages": {
"javascript": "javascriptreact"
}
Now the lorem
abbreivation will work:
And if you have "emmet.triggerExpansionOnTab": true
set, then you can hit tab to expand the text.
However Emmet completions will not show up for the case you showed: the string "lorem5"
. The reason is that emmet sees the closing "
immediately after the abbreviation so it decides not to return any completions. Instead, you have to use the Emmet: Expand Abbreviation command
(which is bound to tab
by default) to force emmet to expand lorem5
:
In new VsCode Verison you need to following step:
Go to vs code setting enter image description here
then find emmet in search setting
then add javascript in Item and javascriptreact in Value
Here are some screenshots that will help you
© 2022 - 2024 — McMap. All rights reserved.