简体   繁体   中英

Visual Studio 2015 JavaScript Intellisense strange behaviour

I am working on MVC application in Visual Studio 2015. Suddenly, intellisense for JavaScript files started behaving strangely. Sometimes, the intellisense does not pop up but it can be displayed using keyboard shortcut. The worse problem is that it does not show local variables. The screenshot is here: http://i.imgur.com/RvyQVTm.jpg . The local variable abcde is not in the list. Here is a screenshot of the right behaviour: http://i.imgur.com/w5LM0JA.jpg . I encouter similar behaviour for object atributes when writing method (intellisense does not show attributes when writing this. ).

The problem started happening on my laptop. I tried to solve it. I tried different solutions but with no luck. The reason is that the solutions I found were not for my specific problem. I even tried reinstalling Visual Studio.

Since I was not able to fix it on the laptop I tried installing Visual Studio on my desktop with fresh Windows 10 installation. I created new project and transfered files from laptop to the new project. Intellisense was working in the new project. I wrote some code, saved the project and turned the computer off.

When I returned to my project after few days I noticed that the intellisence was behaving the same way as on the laptop.

The most interresting thing is that the intellisense works in any new project I create.

I'm really desperate because I have already spent so much time trying to fix this issue. I will be glad for any help.

Since the time I posted this question I found out some ways how to minimize (maybe even fix) the issue:

  1. I created new solution for the project and moved all files there by copying their contents.

  2. I do not turn the computer off. I use hibernation with Visual Studio running. This might not be necessary because my project survived one Windows Update restart and several VS restarts due to plugin updates.

  3. If you encounter the issue, check for syntax errors as gpersell suggests. Once, the intellisense got broken for me when I tried calling function with missing parentheses.

  4. If you are sure there are no syntax errors, leave the computer for a while. This might sound stupid but it already helped me three times. I usually leave computer for 5 - 15 minutes with Visual Studio running with project open and when I come back the intellisense works again.

  5. Do not delete contents of the \\obj\\Debug and \\obj\\Release folders. Use Visual Studio's Clean Project feature instead.

  6. If nothing of the above helps, start again from the point 1.

I hope this helps someone.

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