Skip to content

Support enclosing ranges for function definitions#172

Merged
jupblb merged 1 commit intoscip-code:mainfrom
podtserkovskiy:enclosing_ranges_for_functions
Nov 24, 2025
Merged

Support enclosing ranges for function definitions#172
jupblb merged 1 commit intoscip-code:mainfrom
podtserkovskiy:enclosing_ranges_for_functions

Conversation

@podtserkovskiy
Copy link
Copy Markdown
Contributor

@podtserkovskiy podtserkovskiy commented Oct 7, 2025

Supported enclosing_range for function definitions only.

Introducing additional traversal with ast.PreorderStack, because ast.Walk doesn't allow to access information about enclosing nodes.
The implementation code would be a bit simpler if ast.PreorderStack be used for the main traversal.

For #92

@podtserkovskiy podtserkovskiy force-pushed the enclosing_ranges_for_functions branch from 94e8caa to cbe47ef Compare October 13, 2025 22:32
@podtserkovskiy podtserkovskiy marked this pull request as ready for review October 13, 2025 22:33
@podtserkovskiy
Copy link
Copy Markdown
Contributor Author

@jupblb This PR is now ready for the review.

However, I use pre-release version of github.com/sourcegraph/scip. I can update go.mod as soon as a new git tag published.

@jupblb
Copy link
Copy Markdown
Collaborator

jupblb commented Oct 14, 2025

I've created scip-code/scip#344, awaiting review

@jupblb jupblb self-requested a review October 29, 2025 20:02
@podtserkovskiy podtserkovskiy force-pushed the enclosing_ranges_for_functions branch from cbe47ef to ca009fe Compare November 6, 2025 18:14
@podtserkovskiy
Copy link
Copy Markdown
Contributor Author

I upgraded go.mod as scip-code/scip#344 merged

@podtserkovskiy podtserkovskiy force-pushed the enclosing_ranges_for_functions branch from ca009fe to a8c1677 Compare November 6, 2025 18:17
Copy link
Copy Markdown
Collaborator

@jupblb jupblb left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Thank you so much for this contribution!! 🎉 Please take a look at two minor comments, I'll try to review further changes ASAP. 😃

Comment thread internal/visitors/visitor_file.go
Comment thread internal/index/scip.go Outdated
@podtserkovskiy podtserkovskiy force-pushed the enclosing_ranges_for_functions branch from a8c1677 to ad6ac1b Compare November 24, 2025 17:31
@podtserkovskiy
Copy link
Copy Markdown
Contributor Author

I've just applied your suggestions. Sorry for the late reaction, I was traveling 😀

Copy link
Copy Markdown
Collaborator

@jupblb jupblb left a comment

Choose a reason for hiding this comment

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

Thanks for all the work! 😃

@jupblb jupblb merged commit e21729f into scip-code:main Nov 24, 2025
4 checks passed
@podtserkovskiy
Copy link
Copy Markdown
Contributor Author

Thanks for the review&merge ❤️

@podtserkovskiy podtserkovskiy deleted the enclosing_ranges_for_functions branch November 24, 2025 23:57
@podtserkovskiy podtserkovskiy restored the enclosing_ranges_for_functions branch November 24, 2025 23:57
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.

2 participants