Closed eduaglz closed 9 years ago
I am fairly certain that you're going to need a _reference.js file that lists your scripts in a reasonable order i.e. the same order in which they appear in your application. Otherwise VS can't find the files that declare your dependencies.
On Thu, Apr 23, 2015 at 1:13 PM, eduaglz notifications@github.com wrote:
According to this post http://blogs.msdn.com/b/visualstudio/archive/2015/02/05/using-angularjs-in-visual-studio-2013.aspx intellisense should also be working on the new VS 2015, but so far I only get intellisense for the angular object and not for the dependencies or my custom modules.
[image: image] https://cloud.githubusercontent.com/assets/5376927/7302873/0ff0620c-e9b2-11e4-89ff-97d090131f4e.png
Here's what I did: 1 Added the angular.intellisense.js to the global javascript references at
C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References 2 Restarted VS2015 And then nothing, it just showed exclamation marks whenever I tried to use intellisense on a $http object.
I also added the file to the same place as my angular.js but it still didn't work. The question that I have in this case is, where should I place the file? on the angular public folder with only my angular.js, or on my dev angular folder where all the files downloaded from bower are.
I also tried addind it directly into the tools/options/text editor/javascriptr/intellisense/reference menu, on the Implicit(Web) reference group, but it still didn't work.
On my project I have the following folder structure inside the src folder:
- wwwroot
- app (my angular site stuff)
- controllers
- services
- views
- lib (js dependencies, only the .min.js file of each library)
- angular
- angular-route
- ....
- _references.js (the visual studio js references file, contains reference to the files inside the app and lib folders)
- Libraries (contains the full libraries as downloaded by bower)
- angular
- angular-route
- ...
As a side note, I don't have a /scripts folder and therefore no /scripts/_references.js file
.
— Reply to this email directly or view it on GitHub https://github.com/jmbledsoe/angularjs-visualstudio-intellisense/issues/25 .
I do have a _references.js, but it is under /wwwroot rather than on the /scripts folder. This is the content of the file:
/// <autosync enabled="false" />
/// <reference path="lib/jquery/js/jquery.js" />
/// <reference path="lib/angular/angular.js" />
/// <reference path="lib/angular-route/angular-route.js" />
/// <reference path="lib/angular-animate/angular-animate.js" />
/// <reference path="lib/angular-mocks/angular-mocks.js" />
/// <reference path="lib/bootstrap/js/bootstrap.js" />
/// <reference path="lib/bootstrap/js/npm.js" />
/// <reference path="lib/flatstrap/js/flatstrap.js" />
/// <reference path="lib/flatstrap/js/npm.js" />
/// <reference path="lib/iCheck/icheck.min.js" />
/// <reference path="lib/underscore/underscore.js" />
/// <reference path="app/app.js" />
/// <reference path="app/controllers/HomeController.js" />
/// <reference path="app/controllers/NavbarController.js" />
/// <reference path="app/controllers/account/AccountController.js" />
/// <reference path="app/controllers/account/LoginController.js" />
/// <reference path="app/controllers/account/RegisterController.js" />
/// <reference path="app/services/AccountService.js" />
/// <reference path="app/services/AuthService.js" />
/// <reference path="tests/AuthServiceTests.js" />
That could be your problem. See the linked post which describes how VS uses _references.js
http://madskristensen.net/post/the-story-behind-_referencesjs
On Thu, Apr 23, 2015 at 2:15 PM, eduaglz notifications@github.com wrote:
I do have a _references.js, but it is under /wwwroot rather than on the /scripts folder. This is the content of the file:
///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// — Reply to this email directly or view it on GitHub https://github.com/jmbledsoe/angularjs-visualstudio-intellisense/issues/25#issuecomment-95675297 .
By "your problem" I mean that _references.js is not in the Scripts folder. Try moving the file and see if it helps.
On Thu, Apr 23, 2015 at 2:18 PM, John Bledsoe jmbledsoe@gmail.com wrote:
That could be your problem. See the linked post which describes how VS uses _references.js
http://madskristensen.net/post/the-story-behind-_referencesjs
On Thu, Apr 23, 2015 at 2:15 PM, eduaglz notifications@github.com wrote:
I do have a _references.js, but it is under /wwwroot rather than on the /scripts folder. This is the content of the file:
///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// — Reply to this email directly or view it on GitHub https://github.com/jmbledsoe/angularjs-visualstudio-intellisense/issues/25#issuecomment-95675297 .
I also thought It could be that, but VS also has a reference to the _references.js under wwwRoot, so that shouldn't be a problem:
Even so, I tried moving it to that location as you said but got the same result
Under the Output windows I'm getting the following message:
I don't know if this might be the reason, but I already checked and I do have the files on that location so I don't know why VS is not able to load them.
Hmm...I'm not sure there is much I can do with it. I actually haven't done anything with VS 2015 support yet; it's all been @jmatthiesen. It looks like your setup is fine.
What version of Visual Studio 2015 (available from the Help | About... menu) are you using? I saw this recently myself.
This is the version that I have:
Microsoft Visual Studio Ultimate 2015 CTP Version 14.0.22609.0 D14REL Microsoft .NET Framework Version 4.6.00030 Installed Version: Ultimate
The issue is gone after installing the RC version of Visual Studio 2015.
Please re-open this issue it is not solved!
I have current release version and it still does not work. My script paths are in App_Start\BundleConfig.cs. Could this be why?
I also have "~/Scripts/_references.js" in "Options/JavaScript/Intellisense/References" dialog.
@GregLarden if you have a project file that demonstrates the issue that would help with diagnosis. Create a new issue if you like and include a link to the project, and I should be able to see what is causing the error.
thank you for the help! I have to make a sample project as this is company project that is not working. I will do a hottowel template.
@jmbledsoe Hi, so I have a repository with the sample project demonstrating the intellisense issue.
Repository name is: VS2015-Angular-Intellisense-Test
Do we need a new issue or can we just reopen this one? I'm sure a lot of people are having this issue.
Hope this helps.. again I really appreciate the help!
I've been having very similar problems with intellisense when trying to write Jasmine unit tests in a Test project. I have created a _references.js file in a scripts folder in the project but I get no intellisense when writing my tests.
@cgsainty So far what I've been finding is that issues are project-specific, so if you have a sample project that demonstrates the issue, please create a new issue pointing to it and include a link to the sample project. Thanks!
Just a heads up. If you create a new ASP.NET Web Application using the "Empty" ASP.NET 5 Preview Template, you won't get a _references.js file. It can be fixed easily...
The cool thing is that it doesn't seem to really matter where you put this file. Make sure you have selected the auto-sync feature though.
According to this post intellisense should also be working on the new VS 2015, but so far I only get intellisense for the angular object and not for the dependencies or my custom modules.
Here's what I did: 1 Added the angular.intellisense.js to the global javascript references at
I also added the file to the same place as my angular.js but it still didn't work. The question that I have in this case is, where should I place the file? on the angular public folder with only my angular.js, or on my dev angular folder where all the files downloaded from bower are.
I also tried addind it directly into the tools/options/text editor/javascriptr/intellisense/reference menu, on the Implicit(Web) reference group, but it still didn't work.
On my project I have the following folder structure inside the src folder:
As a side note, I don't have a /scripts folder and therefore no /scripts/_references.js file
.