unused-class-members FP: methods called only from Svelte <template> member expressions…
- User
unused-class-members FP: methods called only from Svelte member expressions False positive on 2.84.0. Class methods called only from a Svelte
<template>via a member expression (for exampleresultState.pin(...)in markup) are reported asunused-class-member. Fallow tracks template-visible identifiers but not member-expression method calls on a bound instance inside Svelte markup.Repro (2.84.0): asciimoo/hister.
ResultState.onOpen,.pin,.updateLabel, and.addSkipRuleare each invoked from.sveltetemplates (resultState.pin(...)inResultActionsMenu.svelte) yet reported unused. The repo currently setsrules.unused-class-members: "off"to work around it.Expected: credit a method called as
<local>.<method>(...)inside a Svelte<template>when<local>resolves to an instance of the class, parallel to the existing Vue/Angular template member-access tracking.Interface
No new interfaces are introduced.
- Assistant
Now let me understand how
bound_targetsgets populated — the FP is aboutresultState.pin(...)in markup. Let me check the actual hister source pattern: - Assistant
The pattern is confirmed:
resultStateis a prop destructured from$props()typed via a same-fileinterface Props { resultState: ResultState }, withResultStatea type-only import. The template callsresultState.pin(...). Let me look at the visitor's typed-binding machinery: - Assistant
Now let me check the analysis side — how member accesses map through imports (including type-only imports):
- Assistant
Now let me look at where
FactoryCallCandidateis defined and the top ofvisit_declaration: - Assistant
Let me write the failing test first:
- Assistant
All 4 fail as expected. Now the implementation — first the helpers refactor:
- Assistant
Now the visitor state in
mod.rs: - Assistant
Now add the resolution methods in
mod.rsafterresolve_factory_call_candidates: - Assistant
Now wire it into the two finalize paths:
- Assistant
Now the visit_impl.rs changes — collection at interface/alias declarations and the object-pattern handling:
- Assistant
Good. Now hook into
visit_variable_declaration: - Assistant
Now the SFC path — resolve candidates before reading
binding_target_names(): - Assistant
All 4 pass. Behavior of extraction changed for unchanged file content, so cached modules from pre-fix runs would miss the new member accesses —
CACHE_VERSIONneeds a bump: - Assistant
Now an end-to-end integration test. Let me check the existing test patterns:
- Assistant
The fixture is fine as-is (
console.log(x)isn't a whole-object use). Now add the integration test: - Assistant
End-to-end passes. Now validate against the actual hister repo:
- Assistant
The
ResultStateFPs are gone. Let me verify the one remaining finding (WebSocketManager.isOpen) is a true positive, not another template FP: - Assistant
Waiting for the background workspace test run to complete before re-running clippy (they compete for resources):
- Assistant
While tests run, update the detection capabilities doc:
- Assistant
The diff looks right. Now I'll wait for the workspace test suite to report:
- Assistant
The workspace suite is still running. Let me review the remaining diffs while waiting:
- Assistant
Waiting for the workspace test suite to complete — the monitors will re-invoke me when it finishes, at which point I'll run the final clippy check and confirm everything is green.
- Assistant
Still compiling/running (the full workspace with
--all-targetsbuilds every test binary). The other two monitors remain armed — they'll fire when the process exits. - Assistant
Still building/running — the
bpi29hy0smonitor (armed on process exit, 15-min window) will notify when it completes. - Assistant
I'll wait for the clean run to complete — compilation is already done, so this should only take the test execution time.
- Assistant
The cgroup PID limit is 2048 and 1981 are currently in use — something is leaking threads. Let me find it:
- Assistant
Orphaned
fallow auditchildren from the killed test run are holding ~1900 threads. Kill them all and rerun: - Assistant
PID count dropped from 1981 to 51. Now rerun the full workspace suite cleanly:
- Assistant
I'll report the results when the suite completes, then run the final clippy gate.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.