Skip to content
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

Open
kritzcreek opened this issue Nov 3, 2016 · 4 comments
Open

Apply all available suggestions at once #80

kritzcreek opened this issue Nov 3, 2016 · 4 comments

Comments

@kritzcreek
Copy link
Collaborator

No description provided.

@chrisdone
Copy link

Maybe you could crib intero-multiswitch to provide a UI like this:

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.

@kritzcreek
Copy link
Collaborator Author

kritzcreek commented Mar 31, 2017

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.

@nwolverson
Copy link

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

@ChrisPenner
Copy link

I think I'd be a bit nervous to use an Apply ALL suggestions hook, but I'd definitely use a Fix all Imports command, psc-ide seems to know what what it's doing with imports quite well and the majority of fixes I do are import fixes.

aij added a commit to aij/dotemacs that referenced this issue May 14, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants