nwolverson / purescript-language-server

MIT License
183 stars 41 forks source link

Organizeing imports deletes comments #184

Closed Geometer1729 closed 1 year ago

Geometer1729 commented 1 year ago

If you have several import blocks with comments between them and you call organize imports it will delete the comments while combining all the import blocks into one block. This is especially not great as organize imports is called by adding an import with tab completion and is therefore often changing imports not visible on the screen so you're likely to not know you've just deleted a bunch of your comments.

nwolverson commented 1 year ago

"organize imports is called by adding an import with tab completion" - this is not strictly true, this is the automatic behaviour of adding imports in purs ide on adding an import (essentially imports are regenerated). If you feel strongly about that you can raise it in the compiler repo, but I have a decent feeling that the maintainers will feel the same way I do - this is something you take on with automatic import management.

I'd recommend not adding comments between your imports if you intend to make use of autocomplete automation, otherwise you can set purescript.autocompleteAddImport to false.