html.tmbundle icon indicating copy to clipboard operation
html.tmbundle copied to clipboard

Consider adding more script types

Open alexr00 opened this issue 4 years ago • 3 comments

Originally from @xatian in https://github.com/microsoft/vscode/issues/98507

If I open an html-file in VS-code I get nice syntax-highlighting since the content is treated as HTML. But depending on tags the language used inside the tag to highlight the code is changed.

<p>This is treated as HTML</p>
<script>
    Everything inside this tag is treated as Javascript.
</script>
<style>
    Everything inside this tag is treated as CSS.
</style>
<script type="unknown">
    Everything inside this tag is treated as HTML.
</script>
<script type="module">
    Everything inside this tag is treated as Javascript.
</script>

Is it possible to register a custom tag tied to a language?

What I actually want is <script type="text/typescript"> that changes the language inside to Typescript. If that is not possible I would also settle for a <typescript> tag since my "build-process" will process this node anyways. Maybe that is already possible somehow? If not please add it. Thank you!

alexr00 avatar Jun 08 '20 08:06 alexr00

Hi, is there any progress on a solution for this issue. I have similar requirement to change the language type of a script tag to Java. Thanks.

nyehamene avatar Aug 28 '22 12:08 nyehamene

Looks like this issue is stale. Does anyone have any suggestions to do this any other way?

gwleuverink avatar Feb 28 '23 18:02 gwleuverink

Alternatively, should syntax highlighting default to JavaScript if the type is unknown?

dmnsgn avatar May 02 '23 19:05 dmnsgn