-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Highlighting of TypeScript embedded in HTML doesn't work and textmate/html.tmbundle cannot be updated as it has been abandoned #1611
Comments
My pull request for an update has been rejected by @aeschli
But the original repository is no longer accepting any changes. On https://en.wikipedia.org/wiki/TextMate
Following the links on https://github.com/textmate/html.tmbundle/blob/master/README.mdown to styleguides for bug reports or pull requests (e.g.) http://kb.textmate.org/bundle_styleguide return a "domain not found" error. |
Similar issue than textmate/html.tmbundle#120 (opened since March 2022). Good luck! You could create a patch to integrate your PR in VSCodium. How to create a patch:
|
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment! |
It's an upstream issue. Closing it. |
Type: Bug
Steps to reproduce
Start a new .HTML file
Embed script with
Rationale for using this feature:
Although embedding TypeScript in HTML probably won't work in any browsers. It's very useful if the HTML is to be pre/post-processed before publishing to be able to have all the benefits of TypeScript while writing the scripts and have it compiled as part of the "site build" process.
I have an ESLint extension that validates <script> tags as plain JavaScript. but if the <script> tag is changed to <script type="text/typescript">, it validates it correctly as TypeScript.
Proof of Concept (Quick and Dirty) Fix
Edit the file
/usr/share/codium/resources/app/extensions/html/syntaxes/html.tmLanguage.json
(which is built fromhttps://github.com/microsoft/vscode/blob/main/extensions/html/syntaxes/html.tmLanguage.json) and replace the occurance of "livescript" with "typescript"
After saving and restarting, the syntax is highlighted as expected.
Long Term Fix
At https://github.com/microsoft/vscode/blob/df7e41cc5ae63ac4f74258ba098deb070acf5ac1/extensions/html/syntaxes/html.tmLanguage.json#L1944C1-L1944C1464
There is a long and complicated (what seems to be a) regular expression with all the text MIME types that the built-in HTML extension treats as javascript. "javascript", "jscript", "ecmascript", "livescript", etc.
Changing the part of this (very long) line that previously was
to
provides a long term fix.
Your reference material
VSCodium version: VSCodium 1.80.2 (ad2ce925243280c8cd1054a2b27734e2b2e839c5, 2023-07-28T18:27:49.392Z)
OS version: Linux x64 5.15.0-78-generic
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Extensions (28)
(1 theme extensions excluded)
The text was updated successfully, but these errors were encountered: