简体   繁体   中英

How to make Visual Studio 2017 intellisense work with javascript?

Running on Visual Studio 2017 with the new Javascript Language Service enabled:

1) Create a ASP.NET Core Web Application

2) NPM Install a package which includes a d.ts definitions (eg npm install axios)

3) Try to consume the installed js in a plain js file (not in a typescript file!)

4) You don't get any intellisense

在此处输入图片说明

If you import the library intelisense lights up:

在此处输入图片说明

So my question is:

What is the correct way to get intellisense without importing the module?

I think if you go to Tools -> Options then go down to the Text Editor branch, expand that and go to JavaScript branch, then expand that and go to Intellisense. There you can explicitly add a reference or you can check a box to download remote references. I haven't tried this but I think it should work, also I'm working off VS2015 so things may be different.

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM