Skip to content

Fix YAML node highlight path resolution#6

Merged
DevROHIT11 merged 1 commit into
mainfrom
codex/fix-yaml-selected-node-highlighter
Apr 8, 2026
Merged

Fix YAML node highlight path resolution#6
DevROHIT11 merged 1 commit into
mainfrom
codex/fix-yaml-selected-node-highlighter

Conversation

@DevROHIT11

Copy link
Copy Markdown
Owner

Motivation

  • YAML node selections in the editor were not highlighting correctly due to conflicting/duplicate path lookup logic and mismatched candidate path handling between YAML and JSON code paths.
  • The goal is to reliably map a selected schema node URI fragment to the correct AST node range for both YAML and JSON formats so editor decorations are placed accurately.

Description

  • Simplified the path resolution in src/components/MonacoEditor.tsx by consolidating candidate-path generation into a single buildPathCandidates function and removing the unused/duplicated getTypedPath/typedPath usage.
  • For YAML, the code now consistently searches doc.getIn(...) over pathCandidates and uses the node's range for decoration placement; for JSON the code finds the first matching node from pathCandidates using findNodeAtLocation.
  • Removed conflicting duplicate node lookups that previously produced ambiguous results, keeping YAML highlighting based on YAML AST node ranges and JSON highlighting based on jsonc-parser offsets.

Testing

  • Ran npm run build, which completed successfully (TypeScript build + vite build).
  • No other automated tests were present or executed in this change set.

Codex Task

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

⚠️ Changeset Missing

This PR does not have a changeset file. To help us effectively version these updates, please run the following command locally:

npx changeset

Follow the prompts to select the version bump and write a short summary.Run:

git add ./.changeset/

Then commit and push the changes to this branch.

If this PR doesn't require a version bump (e.g., docs, CI updates), maintainers can apply the skip changeset label to bypass this check.

@DevROHIT11 DevROHIT11 merged commit e0485d6 into main Apr 8, 2026
1 of 3 checks passed
@DevROHIT11 DevROHIT11 deleted the codex/fix-yaml-selected-node-highlighter branch April 8, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant