Skip to content

Suggest visible nearby names for undefined-identifier diagnostics #1027

Closed

Description

@LunaStev

Motivation

A local count followed by coutn produces an undeclared-identifier message with no spelling candidates. The diagnostic type already has suggestions, but no visibility-aware nearby-name policy is provided by this path.

Starting point: front/error/src/error.rs:339.

Validation

Audited canonical Wave 540728c2eb6cc12f5c69c3fb3fdb96e07ba059a4 (0.0.1-alpha-dev), whose tree matches the local checkout. Validation: Executed undefined-name diagnostic and inspected suggestion interfaces. Executed compiler probes use the matching checkout-built compiler and std on Linux amd64 (Rust 1.89.0 / LLVM 21.1.8). Source/header or mocked checks are not native execution on another OS.

Scope

Choose a bounded typo-suggestion policy scoped to the current namespace/visibility. Keep this separate from global parser restructuring and never expose hidden names.

Design discussion required

This issue records a proposal or an unresolved contract; it is not approval to choose new semantics. Please mention @LunaStev to discuss the design before starting implementation.

Completion criteria

  • A close visible name is suggested with a bounded number of candidates.
  • Private, inaccessible and wrong-namespace names are excluded.
  • Deterministic ranking, Unicode inputs and no-good-match cases have coverage.

Activity

  1. added
    enhancement
    help wanted
    discussion
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions