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
Let me look at the actual hister repo structure to understand the failing pattern.
- Assistant
Now let me see how the visitor records variable-declarator binding targets (around line 2039):
- Assistant
Now let me check the existing SFC-level tests for bound targets and find the CACHE_VERSION:
- Assistant
Now I have the full picture. Let me implement. First, the helpers in
helpers.rs: - Assistant
Now the visitor state in
mod.rs— add the struct, fields, and finalize pass: - Assistant
Now add the resolver method and wire it into the finalize paths:
- Assistant
Now the typed object destructure capture in
visit_variable_declaration, plus the recording method: - Assistant
Now wire the SFC path — resolve candidates before harvesting template-visible bound targets:
- Assistant
Now bump the cache version since member accesses for unchanged files change:
- Assistant
Now build and add tests:
- Assistant
Now add the TS-level tests to
classes.rs: - Assistant
Now the Svelte SFC test mirroring hister:
- Assistant
All pass. Now run the full extract suite and verify end-to-end against hister:
- Assistant
The ResultState FPs are gone. Let me verify the one remaining finding is genuine (not another variant of this FP):
- Assistant
While the suite runs, let me review the final diff:
- Assistant
All code is in place and reviewed. Waiting for the workspace test suite to complete — the monitor will notify when it exits.
- Assistant
The suite is still running (output buffered until completion). I'll wait for its completion notification.
- Assistant
Waiting on the background test run — no further action possible until it frees the process table and notifies.
- Assistant
The test task is still active. I'll conclude this turn; the completion notification will trigger final verification.
- Assistant
I've exhausted what can be done while the workspace test suite holds the process table. Ending this turn — the background task (bbp68dbvi) will re-invoke me when
cargo test --workspace --all-targetscompletes, and I'll verify the final results then.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.