lukehoban / atom-ide-flow

Atom IDE support for Flow
MIT License
87 stars 17 forks source link

Autocomplete deactivated for "non-flow" files #24

Closed rainboxx closed 9 years ago

rainboxx commented 9 years ago

autocomplete-plus is awesome, however autocompletion is completely disabled when editing a file that has no /* @flow */ statement at the beginning of the file. I consider this a bug.

mrmurphy commented 9 years ago

Me too, this has been frustrating me for days. Currently I'm not even getting any flow completions.

I still get completions for paths and snippets (I've got autocomplete plugins installed for those), but normal symbol completion doesn't work at all.

I've confirmed the same behavior with two of my co-workers.

I'd love to help debug this if someone wants to give me some direction.


Edit: This is happening for me in flow-enabled files also.

mrmurphy commented 9 years ago

Okay, here's some more information, it looks like we've got some modules in our project that cause flow not to return any autocompletions. So that explains not getting any completions at all.

On the other wise, it looks like normal symbol completion isn't working because the fuzzy provider is blacklisted by this plugin. https://github.com/lukehoban/atom-ide-flow/blob/master/lib/flow-autocomplete-provider.coffee#L8

It seems like it'd be good to still allow fuzzy completion to run on .js and .jsx source, since flow often doesn't provide any autocompletions for projects that are not well and fully typed. And also because not all .js files are flow-enabled.

lukehoban commented 9 years ago

I've gone ahead and removed the blacklisting, so you'll get both Flow results and fuzzy results in /*@flow*/ files.

It appears that duplicates are removed correctly in autocomplete-plus, and this also means that useful keywords like function end up in completion lists, so I think this is overall an improvement as well as fixing the issue with non-flow files.

Fixed in a40bfef79037f628a467b2b5e0a4fd379e829286.

mrmurphy commented 9 years ago

Thanks for responding so quickly, @lukehoban!