Skip to content

Support getting line/column instance information for standard output#595

Open
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
evalon/blaze-supp-abfbec14
Open

Support getting line/column instance information for standard output#595
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
evalon/blaze-supp-abfbec14

Conversation

@staging-devin-ai-integration
Copy link

Support getting line/column instance information for standard output

Summary

Adds a new overload of sourcemeta::blaze::standard that accepts a sourcemeta::core::PointerPositionTracker parameter. When provided, error and annotation unit objects in the Basic output format are augmented with an instancePosition array property ([lineStart, columnStart, lineEnd, columnEnd]).

The position is looked up by converting each unit's instance_location (a WeakPointer) to a Pointer via sourcemeta::core::to_pointer() and querying the tracker. If no position is found for a given pointer, the instancePosition field is omitted. For StandardOutput::Flag, the positions parameter is accepted but ignored (flag mode doesn't produce unit objects).

Files changed:

  • src/output/include/sourcemeta/blaze/output_standard.h — new overload declaration with Doxygen example
  • src/output/output_standard.cc — new overload implementation
  • test/output/output_standard_basic_test.cc — 4 new test cases

Review & Testing Checklist for Human

  • Code duplication: The new overload copies the entire body of the original standard function and adds position-lookup blocks. Verify this is the preferred pattern vs. a shared internal helper, since future changes to the original function must be manually mirrored.
  • Verify position values in tests are correct: The test positions_errors expects [2, 3, 2, 10] and positions_annotations expects [1, 1, 3, 1]. Manually trace through PointerPositionTracker behavior with the given JSON inputs to confirm these are accurate.
  • Missing test coverage: No test for nested instance locations (e.g., /foo/bar/0), and no test for the case where positions.get() returns std::nullopt (verifying the field is correctly omitted). Consider adding these.

Notes

  • All 8 existing test suites pass (make clean).
  • make configure compile passes with no formatting diff remaining.

Link to Devin Session: https://staging.itsdev.in/sessions/c1783be122ec4cec85db12f901d03e67
Requested by: bot_apk

Extend sourcemeta::blaze::standard with an overload that takes JSON pointer
positions (sourcemeta::core::PointerPositionTracker) and augments error and
annotation unit objects with an instancePosition array property
([ lineStart, columnStart, lineEnd, columnEnd ]).

Co-Authored-By: bot_apk <apk@cognition.ai>
@staging-devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants