-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply all available suggestions at once #80
Comments
Maybe you could crib intero-apply-suggestions just applies things in an order to not conflict with eachother. E.g. we insert type-signatures in reverse upwards, and remove modules after that upwards. |
I really like that UI when writing Haskell :P But I think we can get away with something simpler here. Because rebuilds with psc-ide are so quick we should be able to apply suggestions and trigger immediate rebuilds one by one in a temp buffer and then copy the result back into the users buffer. This way we don't get into trouble with overlapping ranges. EDIT: Providing a summary for the different suggestions and letting the user select them one by one would still be a nice thing to provide. We just need to think about how to re-match the selections the user made after applying a suggestion and getting a new set of warnings from the compiler. |
IME on larger projects the rebuild can be not so fast that you'd really want to apply 20 suggestions in order and rebuild in between each of them - though it's still miles better than not having it at all. (In case that sounds ridiculous, for example moving code to another file can leave a big list of import suggestions to remove). Applying in reverse order sounds easier than what I did elsewhere, which is either traversing with couple of pointers to see where we have got to, or having markers which track where they are (the atom ones do that so that they stay with text when you edit above them). You can always do multiple passes of that if it's conservative wrt overlaps |
I think I'd be a bit nervous to use an |
psc-ide-emacs drove me over the edge with the ergonomics of the `C-c M-s` shortcut and purescript-emacs/psc-ide-emacs#80
No description provided.
The text was updated successfully, but these errors were encountered: