nkt / atom-autocomplete-modules

Autocomplete for require/import statements
https://atom.io/packages/autocomplete-modules
MIT License
114 stars 35 forks source link

support flow and replace previous typed text #127

Closed lloiser closed 5 years ago

lloiser commented 5 years ago
  1. support flowtype files
  2. add a replacementPrefix the remove the text in front of the cursor before adding the suggestion text
jonyeezs commented 5 years ago

Could you help shed some light what problem 2nd commit is trying to solve?

Was there an issue associated with this?

lloiser commented 5 years ago

For some reason it always ended up adding the suggestion to the entered text.

E.g.

require('./lib/Tree')
                   ^ cursor right before the '

I got the correct suggestion TreeView. But using it then resulted in

require('./lib/TreeTreeView')

So my idea was to tell the autocomplete service to ignore the first entered text Tree and replace it with the suggestion. But to be honest I cannot reproduce it with the current published version (that do not include these fixes here). I will try again...

lloiser commented 5 years ago

I have reverted the second commit, it also works without it.