#149 Autocomplete add imports and cabal deps without asking

closed-fixed
JP Moresmau
Bug (46)
5
2012-05-28
2012-04-12
Tobias Bexelius
No

If you hit autocomplete (Ctrl + Space) on a partially written word that only has one match that one is selected automatically, which might mean that imports are added to the module or, even worse, that dependencies are added without your knowledge. The added import is usually spotted as it happens, but not the added dependencies.

This happens quite commonly for me when I try to auto complete an identifier from a project module that I have forgot to import (as I reported earlier), but even with that fixed I think it is too easy to accidently trigger this behaviour by a misspell.

Discussion

  • JP Moresmau
    JP Moresmau
    2012-04-18

    Well, the automatic addition of imports and dependency is a feature, not a bug. So I'm not sure how this can be "fixed" while keeping the ease of use of automatic dependency addition. Of course, you can change in the preferences that you don't want to see all possibilities in auto complete, only the symbols in modules you already import or in packages you have dependencies on. Then you won't get the issue.

     
  • Isn't it possible still show the popup with a single suggestion? A list with a single element still gives you two options (to select the single item or select none).

    Whenever I have two or more choices, I will also have the option to press esc and choose none of them. In many cases, what I wanted was something that eclipseFP wasnt able to find (because I forgot an import earlier) or I have misspelled the word, so it is just as common for me to select none.

    I think it is a bug that whether I am given an option to escape the auto completion depends on how many packages I have installed, i.e. if eclipseFP will find one or more suggestions.

    For now, I'll disable the feature, which is a shame since it is really useful from time to time.

     
  • JP Moresmau
    JP Moresmau
    2012-04-19

    I'll have a look, but I fear this is Eclipse's behaviour. We just provide the possible completions.

     
  • I have changed in the preferences that I only want to see package dependencies, and I must say the whole experience is much more pleasant now!

    Thanks for doing a great job on EclipseFP by the way! :)

     
  • JP Moresmau
    JP Moresmau
    2012-05-28

    • assigned_to: nobody --> jpmoresmau
    • status: open --> closed-fixed