Peekmo / atom-autocomplete-php

Autocomplete for PHP in atom editor
MIT License
136 stars 34 forks source link

Bugfix - Consolidate providers and make autocompletion context sensitive. #150

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hello

This is a larger pull request that does the following things:

That's mostly it. The introduced changes will make our autocompletion a great deal more correct and useful. However, as the changes are large, this will require proper testing as usual.

Peekmo commented 9 years ago

Hi thank you.

I'll test it today

ghost commented 9 years ago

Ok, I'll also be testing it today, and looks like I already found a bug. The regex in member-provider should be:

@regex = /(?:[a-zA-Z0-9_]+)(?:\(.*\))?(?:->|::)([a-zA-Z0-9_]*)/g

As now it is only autocompleting after the arrow or double colons (it doesn't fuzzy match after that). I'll fix it as soon as I get to my development machine again, but I'm placing it here so you can change it in your local version for testing in the meantime.

Peekmo commented 9 years ago

Ok thank you, I'm changing it and push it

ghost commented 9 years ago

Looks like there's more I broke, my last post fixed fuzzy matching, but chaining methods still no longer works. This should fix it:

@regex = /(?:(?:[a-zA-Z0-9_]+)(?:\(.*\))?(?:->|::))+([a-zA-Z0-9_]*)/g

When I was testing this locally I was testing all the different keywords immediately after the -> and ::, which is why I didn't pick up any of these things. But hey, that's what testing is for, right ;-).

Peekmo commented 9 years ago

I didn't start to write a PHP code for the moment, so didn't test for the moment ^^

I push your new regex ^^

ghost commented 9 years ago

Thanks for quickly updating it, I haven't encountered any other bugs after this was fixed.

Peekmo commented 9 years ago

Me too, I pushed a new release ;) Would you like to give me your full name in order to create a CONTRIBUTORS.md in the repo with your full name in (if you want)?

ghost commented 9 years ago

Sure, I've sent you an email about it (sadly PM's are not possible on GitHub).