atom / autocomplete-snippets

Adds snippets to autocomplete+ suggestions
MIT License
46 stars 50 forks source link

`::` breaks autocomplete #39

Open a-moses opened 9 years ago

a-moses commented 9 years ago

the sign ' : ' break the autocomplete prosses

for example

Closure Closure::bind

iarief commented 9 years ago

have run into this issue too while trying out the snippets for language-laravel. is there any way to fix this? after we type ':' the autocomplete think that we're trying to type a completely new snippets and didn't take into consideration about what was written before the ':' character

joefitzgerald commented 9 years ago

Can you please post the full snippet text for a snippet that exhibits this behavior?

iarief commented 9 years ago

of course! it's part of the atom package here https://atom.io/packages/laravel when i try to use the snippet for Route::get snippet, i need to type ro:g for it to work. but if autocomplete-snippets and autocomplete-plus is on, it consider the g as a new autocomplete keyword / search

--edit now that i think about it, doesn't it seems like it is autocomplete-plus bug rather than the autocomplete-snippets bug?

joefitzgerald commented 9 years ago

Yes, it is an autocomplete-plus bug. https://github.com/Cronos87/atom-laravel/blob/cebcc3174c5d1d8834eebc674708f270749a0c53/snippets/laravel.cson#L24-L27 seems to capture a test case that we can use.

joefitzgerald commented 9 years ago

Your Route::get snippet is here: https://github.com/Cronos87/atom-laravel/blob/cebcc3174c5d1d8834eebc674708f270749a0c53/snippets/laravel.cson#L451-L454. I'll use that.

iarief commented 9 years ago

hi, i've found out the modification needed to allow autocomplete-plus to recognize snippets with colon characters. it's these https://github.com/atom-community/autocomplete-plus/blob/master/lib/autocomplete-manager.coffee#L34-L35

https://github.com/atom-community/autocomplete-plus/blob/master/lib/fuzzy-provider.coffee#L11

should i do a pull request? since this modifies the fuzzy provider which, according to the wiki, is already deprecated

joefitzgerald commented 9 years ago

@benogle is it valid for a snippet's groups to be nested like this: Route::input(${1:'${2:name}'})$3 (i.e. group 2 is nested inside of 1). I have replicated a failure in our autocomplete-snippet parsing if the groups are nested. The double :: doesn't cause any issues.