NameIndex

class NameIndex

A name -> elements lookup over a model, built once by build_name_index().

Two maps are held:

  • by_qualified_name maps the rendered qualified name (e.g. "Pkg::Sub::Name") to the unique element bearing it. A model assigns a qualified name to at most one element per name (collisions leave the later elements with qualified_name == None), so this is a plain dict.

  • by_simple_name maps an element’s simple name to every element bearing that name anywhere in the model (names are not unique), so its values are lists in first-seen (scan) order.

The maps are populated from model.nodes(Element, include_subtypes=True) and therefore cover every document of the user model. Library elements are not scanned (DocumentKind.MODEL scope).

Members defined in NameIndex (2 members)

Attributes

by_qualified_name: dict[str, syside.Element] = None
by_simple_name: dict[str, list[syside.Element]] = None
Used in