jmbledsoe / angularjs-visualstudio-intellisense

Visual Studio extension providing statement completion for injected AngularJS components in JavaScript files.
MIT License
110 stars 22 forks source link

Intellisense not working in existing modules in Visual Studio 2015 #33

Closed ltlombardi closed 8 years ago

ltlombardi commented 8 years ago

I have everything well configured with the _references.js file, and I get intellisense for other libraries, like jQUERY, but I can't get it to work properly for AngularJS.

For example. in the bellow picture I'm creating a new module and adding a directive and I get intellisense for the $http angular object, which is fine.

jmbql

But in the bellow picture the module is already created and so I don't put the empty array in the module declaration. If I did, it would overwrite any previous declared module, rendering my app useless. Even though everything works fine with the code, intellisense is gone: uaftk

I've been searching for more than a month. Any ideas?

jmbledsoe commented 8 years ago

This has to be a _references.js issue. If the Intellisense engine can't find the module declaration in a file referenced there then it won't be able to spin up AngularjS.

If you post a sample project that demonstrates the issue I will take a look.

ltlombardi commented 8 years ago

@jmbledsoe, thank you! I ziped everything but the packages and .vs folder. Hope it's enough. WebApplication1.zip

jmbledsoe commented 8 years ago

Move angular.js and angular-mocks.js ahead of your application files in _references.js. Files in _references.js need to be in the same order as they are in your index.html for Intellisense to know what to do with them.

ltlombardi commented 8 years ago

Again, thank you very much. This fixed it.

I didn't find this information anywhere. I imagine this happens to 99% of users, because the "update javascript references" command that auto add every JS file in the _references.js doesn't care about the order, nor does it gives any warning nor any of the documentation do. not that I could find.

jmbledsoe commented 8 years ago

Yeah the docs need updated. Feel free to create a PR!

ltlombardi commented 8 years ago

I want to give back to the community. I'm planning to do a complete guide about VS Intellisense, including AngularJS. I never did a pull request. It's gonna be my pleasure doing it for the first time. :smile:

jmbledsoe commented 8 years ago

Awesome! Thanks!