question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[html] Javascript intellisense in inline scripts from external references

See original GitHub issue

This 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:open
  • Created 6 years ago
  • Reactions:96
  • Comments:36 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
prayaggandhi1080commented, May 18, 2017

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.

11reactions
JohnnyFuncommented, Jan 17, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found