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

Improve support for Javascript in HTML #15377

Closed
aeschli opened this issue Nov 11, 2016 · 9 comments
Closed

Improve support for Javascript in HTML #15377

aeschli opened this issue Nov 11, 2016 · 9 comments
Assignees
Labels
plan-item VS Code - planned item for upcoming
Milestone

Comments

@aeschli
Copy link
Contributor

aeschli commented Nov 11, 2016

No description provided.

@aeschli aeschli added the plan-item VS Code - planned item for upcoming label Nov 11, 2016
@aeschli aeschli added this to the November 2016 milestone Nov 11, 2016
@aeschli aeschli self-assigned this Nov 11, 2016
@gertcuykens
Copy link

gertcuykens commented Nov 12, 2016

And typescript :D #14032 see comment

The tsserver supports embedded js (and ts for this matter). VSCode will need to extract the script tag contents, and send them to the server. all other LS operations should work regularly from this point on. No work on the tsserver-side should be needed, so microsoft/TypeScript#11739 should be closed, and this issue reopened (unless there is another issue tracking this work on the vscode side).

It is worth noting that this is hte same support that VS 2015 uses to drive intellisense and other Language Service features in empeded JS code in script tags.

@bgashler1
Copy link
Contributor

This would be great. I currently can only get intelliSense in my JS files—but not in HTML files with script tags.

@s130059660
Copy link

I'm using the latest insider 1.8 builds.
Now, native js autocomplete works. However, imported modules don't.

@waderyan
Copy link

Note - duplicate issue here #3465
User feedback in comments.

@aeschli
Copy link
Contributor Author

aeschli commented Nov 23, 2016

Added single file support for JavaScript in HTML (no script includes are followed).

@JeremyBYU
Copy link

Is there a plan to allow intellisense for imported variables in <script> tags inside html files?

@aeschli
Copy link
Contributor Author

aeschli commented Feb 9, 2017

No, it's currently not on the plan. We first want to see how much the demand for more support for JavaScript inside HTML is. Please file issues or vote (add thumbs ups) on existing ones.

@SMotaal
Copy link

SMotaal commented Feb 16, 2017

So, going over the various threads regarding <script ...> /* can we have syntax highlighting and autocomplete here please */ </script>, I see several issues, same requests, then why moving from one language service might have broken the feature (I assumed it was there), then what it might take to get it done (maybe), finally how this is a duplicate and now issue needs to be merged [rinse repeat ...]

As an observer, who has been waiting for the feature but decided to observe, I think we need a better mechanism to communicate! I really do appreciate how much effort is involved to manage all those threads in a consistent manner, and let's not forget having to actually work on the project. So, maybe if we can think of a better system around unique features (and maybe sub-features or preferences) and have one place for people to vote.

My opinion: this [reliable editing of scripts in tags, like scripts in files, and enough contextual awareness of the fact that the script is in this particular HTML] is important and there is enough justification to give it some importance.

Thanks!

@arc41t3ct
Copy link

when opening the script tags with <script type="text/javascript"> intellisense works inside html files.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plan-item VS Code - planned item for upcoming
Projects
None yet
Development

No branches or pull requests

8 participants