angular-ui / AngularJS-sublime-package

AngularJS code completion, snippets, go to definition, quick panel search, and more.
MIT License
1.42k stars 169 forks source link

Completions does not work after $scope. #45

Closed alexilyaev closed 10 years ago

alexilyaev commented 10 years ago

$on does not trigger a completion menu if typed after $scope.. Also not triggered if pressing Ctrl + Space in that case.

Similar for other methods like $apply

ST3 Stable, 3059 on Win8 x64

subhaze commented 10 years ago

This seems to be a bug in ST. I can duplicate this, however, I setup some logging to print out the completions returned to the console, and they're there... So somewhere between the plugin returning the completion list and ST processing them, they're getting lost.

I'll see if I can find a work around.

makc commented 10 years ago

It might be different bug, but I thought I 'd let you know that for some reason your package prevents ST from showing completions from other packages, too.

subhaze commented 10 years ago

@makc Which completions are you experiencing this with? This issue is with the JS snippets. Are the JS snippets causing the issue or is it the HTML attribute/element/filter completions causing this, or worse case all of the above :) ?

makc commented 10 years ago

@subhaze no, I mean this angular-ui/AngularJS package. here is how our plugin completions list looks like for tutorial 2 if AngularJS package is not installed: screen shot 2014-02-05 at 3 34 08 pm When I install AngularJS package, there is no completions list at all. When I uninstall it, completions come back.

subhaze commented 10 years ago

@makc 'no, I mean this angular-ui/AngularJS package' I was talking about this package, sorry for the confusion. I was just asking which part of 'angular-ui/AngularJS package' was giving you the issues since there is more than one area that completions are used.

The screen shot you provided clarifies that, thanks.

Currently it is setup to not use any flags to prevent any other completions. I've had issues before with Sublime not properly handling some chars in the completions and cutting the rest of the completions out (even the completions I was trying to send down the pipe).

So I'll have to dig around a bit and see if I can find what's causing the issue.

Also, this is not a resolution to the issue you describe, but, you can turn off those JS completions via this setting https://github.com/angular-ui/AngularJS-sublime-package/blob/master/AngularJS-sublime-package.sublime-settings#L17

Also, are you seeing this in ST2 or 3 or both?

makc commented 10 years ago

Unfortunately both ST2 and ST3.

subhaze commented 10 years ago

@makc

That's actually a good thing :) I'd rather have consistency than fragmentation.

It looks like a hack I introduced quite a while ago to work around another issue I was experiencing in ST was the culprit. This current issue seems to be more a important fix so I've reverted that hack.

I have to get back to the day job but I'll cut a release this week. In the mean time if you don't mind testing out the develop branch to see if it resolves your issue that would be great!

makc commented 10 years ago

Yes, this commit does fix it. screen shot 2014-02-06 at 2 06 06 pm

subhaze commented 10 years ago

OK cool, thanks for trying it out.

subhaze commented 10 years ago

Release 1.1.5 should resolve this.

alexilyaev commented 10 years ago

Ahm, the completion now works for the Angular methods, but it looks like it disabled some built in completions by ST3.

Expected: js-completion Actual result: no-js-completions

Using "disable_default_js_completions": true brings back the completions.

Any idea?

subhaze commented 10 years ago

I'll look into this tonight. This feature is one I've not really dogfood tested but I'll keep it on so I can catch issues like this quicker. I've also had some ideas on revamping these snippet completions.

All in all, I'll take a look at this tonight and see what's going on and hopefully have a more robust JS completion solution in the coming weeks.

subhaze commented 10 years ago

Had sometime to review this, I assumed it was related to the revert I made for issue #14 and it is...

What seems to be happening is that ST breaks down if there is a . in the completion trigger unless the . is removed from the word separator list. However, doing that causes this issue, #45.

I'm overhauling the JS Completions now. Hopefully, this should provide better suggestions and will be more 'intellisense' like.

alexilyaev commented 10 years ago

Confirmed to work properly now.