Skip to content
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

[html] support script type="text/html" #77977

Closed
nileio opened this issue Jul 26, 2019 · 7 comments · Fixed by microsoft/vscode-html-languageservice#102
Closed

[html] support script type="text/html" #77977

nileio opened this issue Jul 26, 2019 · 7 comments · Fixed by microsoft/vscode-html-languageservice#102
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities html HTML support issues
Milestone

Comments

@nileio
Copy link

nileio commented Jul 26, 2019

  • VSCode Version: 1.36.1
  • OS Version: MacOS

Steps to Reproduce:

  1. create a file with extension .html file
  2. Include a script tag like the following
    <script type="text/html">

3. No auto-complete for html tag names

Does this issue occur when all extensions are disabled?: Yes

HTML inside a <script type="text/html"> tag is recognised as html with syntax color highlights ok, but there is no intellisense autocomplete for html tags like in normal html only files.

@nileio nileio changed the title html autocomplete inside script type="text/html" bug html auto-complete inside script type="text/html" ? Jul 26, 2019
@aeschli aeschli changed the title bug html auto-complete inside script type="text/html" ? [html] support script type="text/html" Jul 29, 2019
@aeschli aeschli added html HTML support issues feature-request Request for new features or functionality labels Jul 29, 2019
@aeschli aeschli added this to the Backlog milestone Jul 29, 2019
@MadCoder253
Copy link

Would this feature request handle the following case?

<script type="text/worker">

This custom type is used by an roll20.net, an online Table Top RPG, when users are developing their own custom character sheets. Everything inside the script tag is still javascript. Would it be possible to have VS Code users define a custom type to be treated as javascript? From what I've read, it's possible to have Sublime treat text/worker as javasript.

@aeschli
Copy link
Contributor

aeschli commented Feb 18, 2020

@MadCoder253 That should be a separate request.

@Sau64
Copy link

Sau64 commented Apr 16, 2020

There is also no code folding. Removing type="text/html" enables code folding but html emmets are lost.

@aeschli aeschli added the help wanted Issues identified as good community contribution opportunities label Feb 22, 2021
@aeschli
Copy link
Contributor

aeschli commented Feb 22, 2021

For anyone interested in working on this: I good starting point for this is

if (/["'](module|(text|application)\/(java|ecma)script|text\/babel)["']/.test(scanner.getTokenText())) {

@aliasliao
Copy link
Contributor

Hi @aeschli , I'm working on this issue and found that the problem might be fixed by microsoft/vscode-html-languageservice#102. I'm not sure if pr #117360 is necessary since html code in <script type="text/x-handlebars-template"> works pretty well without setting languageIdFromType = 'html' like this.

image

@aeschli
Copy link
Contributor

aeschli commented Feb 23, 2021

You are right, that can be fixed in the HTML language service, I forgot about that. Thanks for the PR!
We can close #117360 then

@aliasliao
Copy link
Contributor

@aeschli Could you please review my PR microsoft/vscode-html-languageservice#102? Thanks a lot!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities html HTML support issues
Projects
None yet
5 participants