Repository navigation
fix(contexts): compare again when a file either compile read changes - #1179
16bit-ykiko wants to merge 5 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Why
A file with no database entry of its own — a unity build's part, another included
.cpp, a header that is not self-contained — compiles either alone or in its host's context, whichever has fewer errors. That decision depended on both compiles, but the open document was tied only to the compile it last ran. In a unity build whereunity.cppincludesb.cppand thena.cpp:#include <string>inb.cppmakesa.cpp'sstd::stringan error whichever way it compiles. That is a tie, and on a tiea.cppswitched to compiling alone.a.cppreads nothing ofb.cpp. Restoring the include and saving never compileda.cppagain, so its error stayed untila.cppitself was edited.What changed
SelectedCommand::inputs, moved there fromResolution). This holds whether the result comes from the store (Project::self_containedhands out the stored result's inputs) or was just found by the attempt (CompileAttempt::found). The sends after the check compile under that result rather than reading the store again, which a change during the compile could have cleared. An open document therefore compiles again, and compares again, when any file either compile read changes.DocumentCompile::in_context). A file that has not yet compiled in the context still compiles alone on a tie, asclice inspectdoes.firstflag of the compile attempt is gone. The design page (en and zh) states the tie rule and what the result depends on.Tests
contexts/self_containment/22_earlier_part, a unity build whose part uses a name declared by the part included before it:declared later: a tie, then the earlier part declares the name.declared after typing: the same, with the part edited in between so it compiles under the stored result.tie keeps context: the reported scenario, in context, then a tie, then the fix.main, all three fail at their checks: the part stays compiled alone, or leaves the context on the tie.