Visual Studio 2015 JavaScript Intellisense strange behaviour - javascript

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:
I created new solution for the project and moved all files there by copying their contents.
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.
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.
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.
Do not delete contents of the \obj\Debug and \obj\Release folders. Use Visual Studio's Clean Project feature instead.
If nothing of the above helps, start again from the point 1.
I hope this helps someone.

Related

File operations taking long time, receiving "Running [file, save, delete create participants" message

Happening with VSCode version 1.52.1, while working with JavaScript, React, and Node.
I've been working on a React project in VSCode for a couple months now. At some point, in those two months, I started noticing a significant decrease in the speed at which VSCode handles file operations. Like, slow enough that I was creating a single css file, and I went to fill up my water bottle at the cooler and I came back and it still needed about another minute to finish. After browsing some of the VSCode "Issues" on GitHub, I noticed that someone mentioned it might be an issue with the Prettier formatter, but I'm still having the same issue when saving, as well as on file creation and deletion.
*Note: this is my first question, and I need more reputation to directly embed the images
A VSCode prompt box displaying the message "Running 'File Delete' participants"
A VSCode prompt box displaying the message "Running 'File Create' participants"
Things I've tried: Disabling "format on save", disabling all extensions, closing and re-opening VSCode, restarting my laptop
I had the same problem with macOS Big Sur 11.5.1 using VSCode (1.59) and turns out it was (in my case) very simple (basically a newbie problem...). I had been downloaded VSCode and was executing it in Downloads directory. All worked fine but when had to create or rename some file/folder, it took a long time 'Running "File Create" participants' ... After moved the application to Application's folder, the problem was solved.
I had the same issue with Code 1.53.2 on RHEL7. I would perform any file operations within VS Code (save, create, delete, rename), and I would get the Running 'X' participants dialog.
I solved it by downgrading to 1.52.1. Not sure what OS you are running, but it might be worth it to downgrade Code to a version you know was working well for you, and keep an eye on latest development to see if it works itself out.
Hope this helps!
I have encountered the same issue today (Visual Studio Code 1.52.1) while working on CSV and HTML files. Saving a file took like 1 or 2 minutes to finish. I have resolved it by updating VS Code to 1.53.1 version and disabling all extensions.
I have re-enabled extensions one by one to see if the issue came from a specific extension. It still works so far.
even i encoutered the same problem with basic python programs. even creaing new files and deleting them took minutes. it is not about how old or new your machine is. it is about workspace and vs code. when you open a new workspace, vs code runs it in a so called restricted mode where a lot of things are limited. extensions, de-bugging and a lot of other things. on the bottom left of your vscode, click on restricted workspace and then select the 'trust workspace' option. worked for me.
I have this too. In windows, I had drive w: assigned (subst.exe) to my project folder. It started taking a long time to create/rename/delete files. I tried opening directly from the physical drive and it went away. I tried re-assigning w:\ up the file tree a bit and it also went away.
I encountered the same problem recently(in Nov 2021).
I just closed that workspace and reopened same workspace again, and luckily my problem got solved.
I found this bug ticket being reported: https://github.com/microsoft/vscode/issues/128263
What the hell is Running 'File Delete' participants... all about. It
takes several minutes to create a blank file and several minutes to
delete a file. How do I turn off whatever this is. VS Code is basically
unusable with whatever this is enabled.
The solution apparently was this:
Microsoft Live-Share was the culprit. Disabled that and everything is back to normal.
Disable some vs code extensions, one by one as you test, you will surely land on a culprit.
Same is happening with me, I am on iMac, macOS Monterey Version 12.6(21G115):
Version: 1.71.2
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Date: 2022-09-14T21:05:37.721Z (1 wk ago)
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 21.6.0
Sandboxed: No

VS Code Node.js macOS debugging not working - I don't even know how to state the problem

Newbie question here, it seems... I'm losing my mind. Why is this so hard? I've been programming other languages for years, but I'm relatively new to node and JS. I've read and watched as much as I can find official and unofficial on the web about this and it's either years old or significantly different from my situation, so not very helpful.
I'd really, really appreciate anyone who can understand my (pretty simple, I would have thought!?) specific case and help me get this set up to just work. Possible?
macOS 10.15.6 Catalina.
As I understand it, node comes with the OS. It's Node.js 12.8.1
VS Code 1.48.2
I create a new file, name it abcd.js. VS Code figures out it's javascript. I add some code - read a file of JSON from the disk, make some changes, console.log some stuff (appears under the Output tab). I run it.* All good and works.
Now... Run menu > "Start Debugging". Or, There's a Run/Debug icon in the sidebar that shows a "Run and Debug" button which I click on. Both of those ask me for an environment - I choose Node.js, and the Debug console outputs this:
/usr/local/bin/node path/to/my/file.js
Debugger listening on ws://127.0.0.1:56430/30b0c2aa-278b-4540-94c4-825d30b94f57
For help see https://nodejs.org/en/docs/inspector
And that's it. I have breakpoints, but it doesn't stop on them. Something happens (too quick to see what it is). I don't think it's actually running my code because nothing new shows up under the Output tab.
There's also a note in that sidebar saying "To customize Run and Debug create a launch.json file." I've experimented with that as much as I can, but nothing I do seems to help.
I've been programming for years. I'm used to other languages and IDEs (eg. C, Java, AppleScript, Swift, others), where you open the IDE, write some code, hit run (or debug), it may or may not build a target (depending on the language and environment), but then it runs the code (opens the target app, or runs in the IDE, and allows you to step through the code, breakpoints, etc. in the IDE if debugging). Is JS/node programming radically different from this somehow?
*One theory:
I'm not doing this through any terminal or any browser. Maybe that's the problem...? At some point I installed a "Code Runner" plugin that I believe is what is running my code. It was a while ago, but if I recall correctly maybe I turned to that because I was looking for the experience I've described above, and this plugin gave me that where the "normal" node setup process didn't? Perhaps my problem is that that plugin simplifies RUNNING js scripts so much that my issues with DEBUGGING exist because that plugin allows me to bypass other usual complications with running JS/Node scripts (but doesn't have any debugging functionality of its own)?
My thanks to #ippi for his/her comment with a gif video. Not sure if the following really answers my question, but I'm posting it in case it helps anyone else.
I took some time to clean up my Mac a little, and I completely uninstall VSCode, all its extensions and supporting files and started again.
I re-installed Code from scratch, didn't add any extensions, and then tried what #ippi's video showed.
It still didn't work - I got more or less the same output as in my post, and I'm not sure if it was running the code or not.
I had an urgent deadline to meet so didn't come back to it till now - two days later - and now, it's working.
A couple of things changed in that time though I really don't know what fixed this, if it was either of those or anything else. The two changes I can remember that I've done the last two days are:
Despite my post saying my node was 12.8.1, sometime in the last couple of days it turned into 8.something. I updated it to the latest v12.8.3, and
to meet that deadline I used node inspect myfile.js in Terminal for a bit.
The inspect (mostly) worked to meet my deadline, but still a hassle compared to what's shown in #ippi's video. I definitely wanted to get it working that way.
So… updating node fixed it? Running it in the terminal for a bit fixed it? Something else? I'm at a loss to know what did it. But it's working now.
Thanks again to #ippi for that. It pointed me in a good direction at least - to clean up my install a bit, if nothing else.
Maybe this will help someone else sometime in the future.
It seems the ultimate answer is:
It should just work out of the box (possibly subject to updating node to its latest). If it doesn't then:
The issue most likely isn't that you have to do any fancy configuring or whatnot to make it work.
Instead, most likely something is wrong with your installation and/or OS and you should explore that.
#ippi's video attached in case his/her link ever breaks:

Breakpoints not hit in javascript files in Visual Studio

I am experiencing some weird behaviors when debugging my MVC Web Application. Some days I experience these issues, but other days everything works fine.
The breakpoints in my javascript files are not getting hit. I get the dreaded "The breakpoint will not currently be hit. No symbols have been loaded for this document." error.
The debugger will detach from the process without me clicking the Stop Debugging button.
I have tried everything I can think of including:
Refreshing the page in IE to force the browser to get the latest version of the javascript files.
Clean / Rebuild the application in Visual Studio
Close / Reopen Visual Studio
Delete all files from bin and obj folders and rebuild
Cleaned up all old sites from my IIS Express applicationhost.config file
Installed VS2013 Update 4
Deleted / Reinstalled VS2013
Removed / Added IE11
Installed VS2015. Same behavior as VS2013
Deleted all local project files and performed a "Get Latest" from TFS
I can manually attach the debugger to an iexplore process and then I'm able to debug that specific file, but it seems like there is a different iexplore instance for each javascript file. I end up having to guess which one to use for each javascript file. To top it off, the debugger keeps detaching in the middle of me trying to find the right process to attach to. It is nearly impossible, and definitely not feasible to try and debug this way.
Our solution is in TFS, we're using IS Express and the three other developers on our team have none of the problems I have. We all have the exact same hardware.
Another clue that might help is that we are using the OWIN functionality to connect to ACS for security. If I bypass authentication through OWIN / ACS I can step into the javascript. This, however, creates other problems since the code is expecting me to be authenticated. This is not an acceptable workaround and, again, the other developers on the team are using OWIN/ACS and do not have any problems.
I'm extremely frustrated and at a loss for how to go about figuring our what is wrong with my environment. Any help will be greatly appreciated.

The JavaScript language has encountered an error and has been shut down. (Tried Suggested links)

Since updating Visual Studio 2013, (Update 2) I keep receiving this error message:
The JavaScript language has encountered an error and has been shut down. Please save your changes, exit, and restart Visual Studio.
This error occurs on old and new projects, and researching into it i dont seem to be getting anywhere. I have tried the obvious (stated in the error message) but this occurs each time i load up a javascript window. I insalled app builder shortly after (Telerik) which also may have caused an issue, im still looking at it myself but would appreciate any suggestions
cheers for any help
not the best answer but it worked for me... I had to completely remove Visual Studio 2013 (along with the Visual Studio 2013 folder in Documents) and reinstall it.
uninstalled Visual Studio 2013 Update 2, and installed Visual Studio 2013 Update 4.
Hope this helps anyone in need of it. but please note that uninstalling and re-installing this software takes around 2-3 hours on some machines
I installed Visual Studio 2015 today and i faced also same error. My previous project on VS 2010. Then I run my project on Vs 2015. Then i opened JS page. It took long time and gave same error. Then I took new JS page from add new Item and paste all the code of old JS file. then i saved it, and previous js file, i have deleted. then i saved the project and exit, then again open the project. and open Js file so there is no error now.
I had this problem when I was replacing the reference ui-bootstrap-tpls-0.13.1.js to the newer ui-bootstrap-tpls-2.5.0.min.js.
Just after including the newer reference (before excluding the older), I got this message and lost all Intellisense for the .js files.
Returned to the older reference to get rid of the error.

The JavaScript language service has encountered an error and has been shut down

Suddenly I receive this error message:
The JavaScript language service has encountered an error and has been shut down.
There is no intellisense in javascript!
What to do?
In my case I have:
Latest VS 2013 Upd.3
Latest Web Essential 2013
Latest ReSharper 8.2.1
Sometimes I see this errors on opening first JS-file after running the solution. I have spent about 2 days on it. Removing Web Essentials helps (also clean the AppData\Local\Microsoft\VisualStudio\12.0\Extensions folder:
extensions.en-US.cache
extensionSdks.en-US.cache
"WebEssentials" folder - it will contain file WebEssentials2013.pkgdef
Then I have tried reset all VS settings and it helped. For a month) Today I have updated solution from the GIT via VS Git Tools (commit contained a lot of JS and CSS changes) and have seen it AGAIN!!!
New solution steps:
Export VS settings.
Reset VS settings
Restart VS.
Check if now it has no any errors.
Import all VS settings EXCEPT Options => TextEditor.
Turn on line numbers for all languages (and if you have some other custom settings - them too)
I don't know who is to blame but I have the fresh Windows 8.1 + fresh VS 2013.
The newest solution steps:
Open the CurrentSettings.vssettings file.
Remove
C:\Users\USERNAME\JsDocComments.js|C:\Users\USERNAME\Modern.Intellisense.js
string from the file
The latest solution steps:
Since I have the laptop with the new clean system w\o this issue I have done the following:
Backed up the PC level ReSharper settings and reset all of them
Reset VS settings with export current one
Restored the PC level ReSharpe settings
Restored the VS exported settings except Options => TextEditor => JS and JS Specific
I have restarted the VS several times and don't see the error now.
Try this solution:
"I was able to fix it: Uninstalling Snippet Designer and deleting the Code Snippets folder on C:\Users\USER\Documents\Visual Studio 2012"
Taken from:
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/d62506a1-4f5f-4013-bcaa-0f827325e424/javascript-language-service-has-encountered-an-error-and-has-been-shut-down
I got this after accidentally copy-pasting a large chunk of HTML into a JavaScript file. Removing said HTML & restarting VS resolved the problem.
In my case, I have Visual Studio 2013 and a Node.js project which is weirdly set up. I just created an empty one and then copied angular-seed into it. So things are not as expected by VS, I guess. I was getting the same error as in the question.
I did not want to uninstal the snippet designer, so I did two things:
I made sure all the snippets in JavaScript folder had shortcuts defined (manually modified xml files) (it was mentioned on the same page Andrea provided link for) - this alone did not help.
I noticed that JavaScript Language Service output widow had a message in it complaining about missing _references.js file. I added the file manually and added only one line to it:
/// <autosync enabled="false" />
Visual Studio stopped complaining about the service failing then. I don't know if fix 2 alone does solve the issue.
ps: I decided to add this info here because this question comes first on Google search for the error. I know it is an old one...
I encountered this issue when I opened a solitary html file.
My workaround is to first open a Solution that contains a web project and then to open a JS file within it. After this, my solitary html file opens without error.
Remove Developer Assistant extension. Work for me

Categories

Resources