angular-ui/AngularJS-sublime-package

"go to definition" always returns "definition <definition name> could not be found"

jetpack01 opened this issue · 11 comments

Using ST3 on Windows 7, pressing "CTRL + WIN + ALT + l", when the cursor is on any Angular element nothing is found (even after rebuilding search index)

Just tested on OS X and all seems fine. I'll be getting a Windows 8 VM setup on my machine soon and test there, if all is well, I'll look into getting Win 7 setup and tested.

@subhaze I opened this issue after trying such feature on my office's windows machine, but now I just tried the same feature on my Mac and I faced the same problem. Where can I find more details on how to use it? Maybe I'm not using it properly?

@jetpack01 After trying a few more tests I have found a bug if the directive attributes are on a newline.

Something like the following

<div
  my-directive-here
  class="blah"
></div>

However, everything else appears to be working fine for me doing exactly what you've described, index project, have cursor on angular element/directive, hit ctrl+super+alt+l

If you're setup is not like the above example that does seem to have a bug there could be a plugin overriding that keyboard shortcut.

Thanks for the feedback.

@subhaze thank you for your tests. Ok, I've found out it works in html files: it's ok with custom directives, with ng-app="FooApp" and so on. But when I try using it in any js file (e.g. with angular services definitions...) I always get the "definition could not be found" message. Is it normal? Maybe it was meant for only angular html custom tags?

Thank you!

@jetpack01 It should work with JS files too, I've checked on a couple of projects on my end and all appears well. Could you check and see if the definitions you're looking for were actually indexed. You can do this via the command palette: super+ctrl+l then typing in the definition name you're looking for.

I'm just trying to narrow down if it's an indexing issue or a lookup issue, thanks!

@subhaze today after trying a few more tests on other projects I have found out that it definitely works ok on OS-X, both on html and js files (maybe I only had some issues with a test project on my Mac when I told you about that), anyway I can confirm that it doesn't work on Windows, neither finding definitions from html nor doing it from js files.

When I use the "look up definition" search from command palette on OS-X it returns all my definitions, on Windows 7 it doesn't (even after rebuilding search index...)!!

Hope it helps!

It definitely helps narrow it down, thanks for all the details.

It seems like there's an issue with indexing on the Windows side. I'm wondering if there's a permission issue on windows not allowing the files to be read during the indexing process.

Is your project on a network drive or just sitting on your local drive?

I'll get a Windows 7 VM setup with ST and see what I can break :)

The project is just sitting on my local drive... ;)

@jetpack01 I got Windows 7 setup, downloaded the AngularJS seed project and was able to index it, search via the command palette as well as go to definition in HTML/js files successfully.

So unfortunately I can't replicate this issue on my side :/

@subhaze Narrowing it down I'm assuming it could only depend on any conflicts with my other plugins.
Thank you again for your tests!

Sorry that this ended in no real resolution and many thanks for all your helpful feedback as well!