-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat/bugfix: on failed update, put dependents below definitions that were in file before running update #5250
Conversation
4098097
to
c4c2327
Compare
You can have gotten into this situation with |
@aryairani Hmm... I'm not sure |
Isn't that just the normal
I guess worrying vs not worrying is kind of a spectrum. I don't think we have to have a super nice polished experience for every deprecated workflow, but also don't want someone to have to throw away their project because they used |
I would still say people with conflicted names, no matter how many, could resolve them one-by one with a |
Oh, and there's also |
I'm tweaking some messages and running down some formatting issues that I noticed in a transcript I'd written about the conflict updates and then probably merging. |
Overview
Fixes #5150
This PR beefs up the
update
implementation a bit to distinguish between the code the user had in their scratch file when they ranupdate
, and the new (transitive) dependents pulled in for type checking with a comment that looks like:The current implementation just uses the rendered
TypecheckedUnisonFile
for the "above comment" definitions. So, those definitions could be arbitrarily permuted from their original order, and all comments are lost. Those improvements could be made in a subsequent PR.This PR also makes
update
enforce many of the merge preconditions that were previously unchecked.update
used to do the wrong thing here.One perhaps notable change: you can no longer use
update
to resolve conflicted definitions. You just have to resolve them some other way, i.e.rename
ordelete
. I had originally tried to preserve this feature ofupdate
but it ended up needing a lot of additional code, and it ultimately didn't seem like a very important feature to keep around. People shouldn't really have conflicted names anymore, and if they do, I don't see why it would be important for them to be able toupdate
their way out of that situation, as opposed todelete
orrename
.Test coverage
No new tests, but existing transcripts have all been updated.