Skip to content

Store Python type aliases and type parameters with semantic symbol kinds #4615

Description

@Widthdom

Summary

Python PEP 695 aliases and TypeAlias/NewType/TypeVar family declarations are persisted as import symbols.

v1.38.0 evidence / reproduction / control flow

SymbolExtractor.cs:897-900 maps type UserId = int, TypeAlias, NewType, TypeVar, ParamSpec, and TypeVarTuple matches to new("import", ...) even though they define names rather than import them.

Impact

Outline semantics are wrong and import filters, unused analysis, and dependency classification can treat local type definitions as imports.

Suggested direction / acceptance criteria

  • Introduce additive typealias and type_parameter (or equivalent catalog-approved) kinds.
  • Provide a compatibility/family mapping for older clients.
  • Update extraction, schema/catalog validation, output documentation, and fixtures together.
  • Assert these declarations no longer appear in import-only queries.

Dogfooding candidate IDs: E021.
Observed with locally built cdidx v1.38.0 from origin/main on 2026-07-15.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions