Tab completion inserts import that creates an import cycle
I have experienced that tab-completion to generate code will sometimes
- add imports that are not actually used in the final version of the tab-completed code (I don't know how this works, it seems like tab-completion makes sometimes intermediary versions that it corrects later, maybe on a second tab press)
- these imports may create import cycles, effectively shutting down the whole HLS interaction (as this is a fatal error)
I just experienced this in the Agda code base (which has 450 modules). It is probably not easy to generate a small reproducer, but maybe some finds one or I can try later.
Hi, thank you for the bug report, I can confirm, that this rather annoying bug hits me from time to time as well, and is a foot gun we definitely need to remove.
It is not with every symbol, though, right? Iirc, it seems to be happening with NoFieldSelector completions in particular.
Dunno, have not had a closer look, but I find quote often random imports that make no sense added to my import collection without confirmation.