[html] Javascript intellisense in inline scripts from external references
See original GitHub issueThis request is to provide intellisense capabilities for referenced script tags on inline javascript, for example:
<script src="myJs.js">
<script>
myJs.IntellisenseGoesHere
</script>
Ideally typings files are also supported for an even better experience
I could not find an open issue on this so per @aeschli 's comment on the last ticket related to this #15377 , I am creating a new feature request here
Issue Analytics
- State:
- Created 6 years ago
- Reactions:96
- Comments:36 (1 by maintainers)
Top Results From Across the Web
javascript Intellisense works on <script> of html but not in .js file
The intellisense does work correctly in a <script> tag within a .html file. Intellisense is working in script tag of html. I tried...
Read more >JScript IntelliSense: A Reference for the “Reference” Tag
The only difference is that you will not see any inline script blocks reflected in IntelliSense. However, you will be able to reference...
Read more >Inline JavaScript in HTML: Don't do it, unless you like really ...
For some external scripts, it requires all the DOM elements to be loaded first, and hence the recommendation is to put the script...
Read more >Working with JavaScript in Visual Studio Code
Visual Studio Code's JavaScript IntelliSense provides intelligent code completion, parameter info, references search, and many other advanced language features.
Read more >The Script element - HTML: HyperText Markup Language
Default: Signals automatic determination of fetch priority relative to other external scripts. integrity. This attribute contains inline ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a much-desired feature. It will be great if VS code team can address this sooner rather than later. Will help a great deal in improving productivity.
It’d be cool even if vscode simply treated the inside of a
<script>
block as though it were a js file at the location where the html file is. Just to get auto-import support would be dreamy. Other features like refactor-extract-function, refactor-rename, etc would be great too.If anyone knows of an extension that does something like that, let me know. Or you know how a simple extension could be thrown together that does that, any insight would be appreciated.
We’re using svelte, so we basically code in an html file and put logic in a script block, so this would be super nice to have. We currently just manually type our imports out, which gets a bit tedious.