问题
The JavaScript IntelliSense is not working on Visual Studio 2017 RTM editor. I can’t even format the code, nothing is working.
回答1:
UPDATE: Looks like latest update of VS 2017 (15.3) solve the issue.
This is because of the new javascript language service http://aka.ms/JavaScriptExperimental
To disable and bring back JS, go to: Tools - Options - text editor - Javascript/Typescript - Language service - General and disable the very first option.
回答2:
Enabling Auto List members helped me:
On the menu go to: Tools > Options >> Text Editor >> All Languages >> General
Uncheck and check back "Auto List Members" to make it a check sign instead of a square Uncheck and check back "Parameter Information" to make it a check sign instead of a square
回答3:
The problem might be that you have too much JavaScript being analyzed due to particularly large JS libs. You can exclude those from your project with a tsconfig.json
file (example below). The only catch is any library you exclude from your project must be explicitly included in the "typeAcquisition"
settings in order to get IntelliSense for it.
{
"compilerOptions": {
"allowJs": true,
"noEmit": true,
"lib": ["es2016", "dom"] // only necessary if you need new stuff like promises
},
"exclude": [
"wwwroot/lib/" //add folders that contain javascript libraries here
],
"typeAcquisition": {
"enable": true,
"include": [
"jquery" // add any libraries excluded in the folders above here
]
}
}
回答4:
Based on which type Project you're working you must install the jquery or other libraries to be helped by Intellisense.
For exemple: if you're using ASPNET Core and want to be helped with jquery statments, you must add a bower configuration file, and then add a Key/Value pair in this file: "jquery":"version"...
After that, build the Project and enjoy the Intellisense working.
来源:https://stackoverflow.com/questions/42772224/visual-studio-2017-rtm-javascript-intellisense-not-working