Skip to content

Provide source locations for parsed specification item IDs #570

Description

@kaklakariada

Problem

OFT parsing currently exposes only an item-level file and line location. Consumers need precise source locations for the individual IDs within a parsed specification item, without parsing the source text again.

Required information

For every complete parsed SpecificationItem, make the following information available:

  • The location/range of its declared ID.
  • The location/range of every covered ID.
  • The location/range of every dependency ID.
  • For each located ID:
    • whole-ID range;
    • artifact-type range;
    • name range;
    • revision range.
  • The semantic SpecificationItemId associated with each occurrence.
  • Distinct locations for repeated occurrences of the same semantic ID.
  • Locations for source constructs whose resulting IDs are partly generated by OFT, including the ranges of every component actually present in source.
  • A documented coordinate convention suitable for editor protocols, including line/column indexing, character encoding, and whether end positions are inclusive or exclusive.

Use cases

  • Semantic highlighting of individual ID components.
  • textDocument/semanticTokens/full.
  • textDocument/semanticTokens/range.
  • Future completion of ID artifact types, names, and revisions.
  • Navigation and reference features without duplicate OFT parsing.

Acceptance criteria

  • Information is available for every OFT importer.
  • It is produced from OFT’s parser rather than reconstructed by consumers.
  • Tests cover declarations, covered IDs, dependency IDs, repeated IDs, multiple IDs, multiline constructs, and abbreviated/generated source syntax.

Metadata

Metadata

Assignees

Labels

Projects

Status
📫 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions