Reputation: 2341
I have an html file with an embedded babel script within it
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>React tutorial</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.2/browser.min.js"></script>
</head>
<body>
<div id="app"></div>
<script type="text/babel">
</script>
</body>
</html>
I would like it be the case that when I'm typing inside the babel script
<script type="text/babel">
</script>
And I type something like <div>
the software autocompletes the end tag by entering the text </div>
in
Neither the auto close tag extension, nor the sublime babel extension, from the visual studio marketplace, was able to do this.
I also followed the advice of this post and created a file named .vscode/settings.json
which contains
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.triggerExpansionOnTab": true
"emmet.includeLanguages": {
"javascript": "html"
}
And this also had no effect.
Upvotes: 18
Views: 2618
Reputation: 174
It worked on me. Are you sure you did everything right?
{
"emmet.includeLanguages": {
"javascript": "html"
}
}
Can you remove the file and add it again? Just what I threw.
Source :
https://code.visualstudio.com/docs/languages/html
https://docs.emmet.io/cheat-sheet/
Upvotes: 4
Reputation: 1241
javascript - Support for script type="text/babel" in Visual Studio Code
Maybe you want look at, this issue is previously discussed and resolved. As for my thoughts, VS Code using regex for intellisense and when I looked at these regex codes, I was already seeing babel but it didn't work in a meaningless way for me too.
Upvotes: 1