Repository navigation
fix(lint): inspect local GPUI handler paths - #62
Merged
Merged
Conversation
Add regressions for method, function and generic handlers, registration order, duplicate registrations, nested execution boundaries and unrelated listener APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collect registered local function definitions across HIR bodies before linting. Match exact enclosing body owners so nested closures, functions and async blocks do not inherit UI execution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerate the catalogue guide and document direct local handler paths, exact body ownership, opaque helpers and the deferred iterator-consumption analysis for render allocations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Refs #22
gpui-ui-blockingnow checks local functions and methods passed directly by path to GPUI listener/action registration, includingcx.listener(Self::save),on_action(cx.listener(Self::cancel)),.on_click(Self::handler)and.on_action(Self::handler).A
check_cratepre-pass visits every local HIR body, resolves registrations against the same GPUI method set as the inline-closure check, and collects callbackFnDefIDs only when they are local. Blocking calls are checked when their exact enclosing body owner belongs to that set. This makes definition/registration order irrelevant and checks a registered function even when it is also called elsewhere. No call graph or parameter-name/type guesses are used.Precision and render allocation:
listener, indirect function pointers, non-local definitions and transitive helper calls stay outside this new path.gpui-render-newstays render-specific: creating an entity in an event handler is valid and has a negative regression case.Iterator::mapis lazy; identifying its closure does not prove consumption during render. A precise extension for.children(items.iter().map(...))needs consumer-aware execution analysis. This PR deliberately does not infer a general render context through iterator adapters.Regression evidence:
cx.spawnwork, nested closure/function/async bodies, a fake listener API and entity construction in a handler.Corpus:
python3 scripts/check-deep-lints.pypassed: 728 root source files and 10 standalone inspector files, zero combined diagnostics, covering all workspace targets and examples. No real new findings, false positives, fixes or new suppressions were needed.Verification on the Mac:
python3 scripts/test-deep-lints.py: passed, 24 expected diagnostics and no extras.python3 scripts/update-deep-library.py: regenerated the committed source ZIP; archive drift test passed.cargo test -p rake-app-cli --locked: passed serially at the fixed head, 361 passed, 2 existing ignored, across 17 suites, using the installed Homebrew Python. An initial overlapping-build run hit the scaffold revision-pin assertion because the test and binary embedded different commit revisions; the serial rerun passed without changing the assertion or test behavior.cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo fmt --all --checkand both standalone lint/UI manifest formatting checks: passed.python3 scripts/check-spacing.py: passed without source fixes.docs/lint.md, the catalogue explanation and its generated skill. AGENTS generation is unchanged and its drift check passed.No dependencies, toolchain pins, workflow files or default syntax-tier behavior changed. The PR remains draft. Remaining: final-head CI must pass, then temporary worktree/target/log cleanup.
🤖 Generated with Claude Code