Support getting line/column instance information for standard output#595
Open
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
Support getting line/column instance information for standard output#595staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support getting line/column instance information for standard output
Summary
Adds a new overload of
sourcemeta::blaze::standardthat accepts asourcemeta::core::PointerPositionTrackerparameter. When provided, error and annotation unit objects in the Basic output format are augmented with aninstancePositionarray property ([lineStart, columnStart, lineEnd, columnEnd]).The position is looked up by converting each unit's
instance_location(aWeakPointer) to aPointerviasourcemeta::core::to_pointer()and querying the tracker. If no position is found for a given pointer, theinstancePositionfield is omitted. ForStandardOutput::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 examplesrc/output/output_standard.cc— new overload implementationtest/output/output_standard_basic_test.cc— 4 new test casesReview & Testing Checklist for Human
standardfunction 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.positions_errorsexpects[2, 3, 2, 10]andpositions_annotationsexpects[1, 1, 3, 1]. Manually trace throughPointerPositionTrackerbehavior with the given JSON inputs to confirm these are accurate./foo/bar/0), and no test for the case wherepositions.get()returnsstd::nullopt(verifying the field is correctly omitted). Consider adding these.Notes
makeclean).make configure compilepasses with no formatting diff remaining.Link to Devin Session: https://staging.itsdev.in/sessions/c1783be122ec4cec85db12f901d03e67
Requested by: bot_apk