Skip to content

Exclude C# parameter modifiers from type-reference extraction #4832

Description

@Widthdom

Summary

C# sites such as out string and out var emit unresolved type_reference rows named out. The modifier is being treated as the type while the real following type is obscured.

Audit ID: P-02. Reproduced on current cdidx v1.40.3. Closed #507 is adjacent reference-classification work, but no exact issue covered this modifier position.

Expected behavior

Parameter and argument modifiers are syntax, not type names. The following real type should retain its normal reference behavior.

PR scope

Keep this to modifier-aware C# type-reference tokenization. General target resolution and named-argument labels have separate issues.

Implementation guide for Codex 5.6 sol xhigh

  • Add fixtures for declaration and call sites using out/ref/in/params/this/scoped, including out var and generic types.
  • Classify modifier positions in the lexer/parser before type-reference emission; do not globally suppress these words because they can appear in other legal contexts.
  • Preserve references to the actual type and do not break declaration patterns, ref returns, ref structs, or out-variable scoping.
  • Add extractor and graph-query regressions, run full tests, and add a bilingual changelog fragment.

Acceptance criteria

  • No modifier token is emitted as a type reference.
  • Real following types still resolve correctly.
  • Existing ref/out/in language constructs retain correct symbols and ranges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions