20

The JavaScript IntelliSense is not working on Visual Studio 2017 RTM editor. I can’t even format the code, nothing is working.

dakab
  • 5,379
  • 9
  • 43
  • 67
Alexandre
  • 7,004
  • 5
  • 54
  • 72
  • Can you add more detail, specifically whether you have a lot of library code and which libraries? I work on the Typescript compiler and that was the first question from one of my team members that works on VS. He offered to help on twitter if you want: @bowdenk7. – Nathan Shively-Sanders Mar 14 '17 at 17:48
  • It's a webforms website and there is a folder called "script" located in root, there is a lot of .js files and when we try to edit those files, intellisense just don't work. – Alexandre Mar 14 '17 at 17:50

4 Answers4

44

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.

enter image description here

Alexandre
  • 7,004
  • 5
  • 54
  • 72
  • 1
    Thanks, this did the trick for me. Just to round things up I think it's worth mentioning that you have to restart VisualStudio to get this setting applied. Since you mentioned that this should be fixed in 15.3 I got curious about why I am getting this issue after upgrading to 15.3.4. However, +1 – Alan Oct 04 '17 at 19:16
  • I had to disable that setting once I installed 15.4 to get basic formatting and highlighting back. I wonder if something regressed. Works for me at least. – julealgon Oct 17 '17 at 18:40
  • +1 helping me too (in 15.4.2!). If you think this didn’t work, even after restarting Visual Studio: the “language service”—that ought to be disabled—might have been automatically re-enabled by modifying or updating VS. If so, just uncheck and restart again. – dakab Nov 08 '17 at 14:27
  • Solved the issue. thanks. – FAHID Dec 15 '17 at 16:01
  • This help me in VS 2017 **but** I have to open this setting and click OK twice before it's working. I don't know why. – vee Jan 03 '19 at 05:44
6

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 enter image description here

Gabriel G
  • 680
  • 8
  • 7
5

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
    ]
  }
}
Bowden Kelly
  • 370
  • 2
  • 5
0

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.

Rafael
  • 966
  • 12
  • 22