Skip to content

Find nearest valid source location by path#21

Open
maratori wants to merge 7 commits into
bufbuild:mainfrom
maratori:parent-path
Open

Find nearest valid source location by path#21
maratori wants to merge 7 commits into
bufbuild:mainfrom
maratori:parent-path

Conversation

@maratori

Copy link
Copy Markdown
Contributor

Closes #20

@bufdev

bufdev commented Oct 28, 2025

Copy link
Copy Markdown
Member

Can you add in the test?

@maratori

Copy link
Copy Markdown
Contributor Author

Yes, is the original test from the issue good enough?

@maratori

Copy link
Copy Markdown
Contributor Author

I've added a test

@maratori

Copy link
Copy Markdown
Contributor Author

@bufdev could you please have a look at the PR?

@emcfarlane emcfarlane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Before merging I wanted to flag an alternative approach to the nearest source location algo. I think this can be improved by first walking downwards to capture the closest descendant before falling back to the nearest ancestor. Added a comment highlighting this approach. Happy to discuss.

Comment thread check/response_writer_test.go
Comment thread check/response_writer_test.go Outdated
Comment thread check/response_writer_test.go Outdated
Comment thread check/response_writer.go Outdated
@maratori

Copy link
Copy Markdown
Contributor Author

@emcfarlane, thanks for your review. I agree with all comments and have updated the PR accordingly.

@maratori maratori requested a review from emcfarlane April 27, 2026 23:26

@emcfarlane emcfarlane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testcases is failing but otherwise lgtm.

@maratori maratori requested a review from emcfarlane April 28, 2026 22:50
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.

feature: use parent source location path if the original one is missing

3 participants