Skip to content

perf(resolve): avoid re-parsing files in build_suggestion_hint #155

@rocketman-code

Description

@rocketman-code

When resolve_targets returns NoTargetsFound, build_suggestion_hint re-reads and re-parses every .rs file via extract_functions. These files were already parsed during the spec-matching loop.

This is on the error path only, so it does not affect happy-path performance. For very large codebases, it doubles I/O and syn parsing work on failure.

Potential fix: collect function names during the initial resolution pass and pass them into build_suggestion_hint, avoiding the second parse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    uxUser experience improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions