Skip to content

feat: implement pointer fragment resolution#12

Merged
ntoulasm merged 7 commits into
mainfrom
feat/handle-fragments
Mar 4, 2026
Merged

feat: implement pointer fragment resolution#12
ntoulasm merged 7 commits into
mainfrom
feat/handle-fragments

Conversation

@ntoulasm

@ntoulasm ntoulasm commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Context

Previously, the visitor only indexed property keys, which prevented navigation to specific array indices (e.g., "#/tags/2"). By refactoring indexing to value Nodes, the "Go To Definition" now jumps inside arrays too.

Summary

This PR adds support for deep linking via URI fragments and refactors the SymbolTable generation to save all JSON value types, including array elements.

Key Changes

  1. Transitioned from a flat node list Array<Node> that stored only reference Nodes to a Map<string, JRefSymbol> where the key is a JSON Pointer.
  2. Moved symbol creation to the entry point of the visit function.
  3. Updated onDefinition logic to parse URI fragments and look up targets in the SymbolTable of this document.
  4. Fixed the existing tests to align with the new implementation.
  5. Added a unit and an integration test to verify "Go To Definition" on a reference with fragment.

@ntoulasm ntoulasm self-assigned this Mar 2, 2026
@ntoulasm ntoulasm marked this pull request as draft March 2, 2026 16:15
@ntoulasm ntoulasm changed the title Feat/handle fragments feat: implement pointer fragment resolution Mar 4, 2026
@ntoulasm ntoulasm marked this pull request as ready for review March 4, 2026 07:23
@ntoulasm ntoulasm merged commit d8f8ac2 into main Mar 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant