fix(tracker): detect every command registration and scope execute's TODOs - #75
Open
BryanFRD wants to merge 1 commit into
Open
fix(tracker): detect every command registration and scope execute's TODOs#75BryanFRD wants to merge 1 commit into
BryanFRD wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three faults in
scanCommandFiles, all measured against a Steel checkout./executecollected every command's TODOs. The inner loop readsfor (const file of files), shadowing the outerfileand walking all ofbuiltins/instead of the execute directory.
/executereported 9 TODOs where 5 live underexecute/, and/locate's and/summon's showed up twice, once on the real command andonce on
/execute.Commands whose factory is not named
command()were missed. The pattern required aliteral
|_| command(), sooperator.rs(|_| op_command(),|_| deop_command()) andreturn(commandpassed by reference) were reported unimplemented. It now accepts any*commandfactory and the bare reference form.The match loop could not terminate. The regex had no
gflag, soexeckept returningthe same first match and the
continueoncommand === "execute"would spin forever. Itnever fired only because
execute/mod.rsuses the reference form the old pattern missed.With the flag set the
breakis no longer needed either, so a file registering more thanone command is read in full.
Effect
Same Steel checkout, script run before and after:
/op,/deop,/return), none lost/executeTODOs 9 to 5domain.rs's TODO goes with them: it registers throughIdentifier::from_steel, is absentfrom
commands.json, and was only ever visible through the/executebug.Tested
bun run buildclean.tsc --noEmitclean underscripts/. Script run against the samecheckout with and without the change, outputs diffed field by field.
Touches the same function as #58, so whichever lands second needs a small rebase.