microsoft / microsoft/node-jsonc-parser

Feature Request: Provide endLine and endColumn for objects, arrays and values

Open
#86 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
759
Forks
66
Avg merge
5d 10h
Merged PRs (30d)
7

Description

I would like to get the line and column an object, array or value ends to be able to get the object at a specific location (line and column) in a document. I have a text based search and would want to get the object at the search location.

It would be awesome if the end line and end column would be provided in the visitor functions in the same ways as the start line and column:
jsoncParser.JSONVisitor.onObjectEnd
jsoncParser.JSONVisitor.onArrayEnd
jsoncParser.JSONVisitor.onLiteralValue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JSONVisitor callbacks named in the issue: onObjectEnd, onArrayEnd, and onLiteralValue. Read how the parser currently tracks and reports start line and column values, then trace the corresponding object, array, and literal completion paths. Done means each callback receives accurate end line and column values for the requested JSON elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.