Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(internal/godocfx): keep some cross links on same domain #3767

Merged
merged 2 commits into from Mar 3, 2021

Conversation

tbpg
Copy link
Contributor

@tbpg tbpg commented Mar 3, 2021

The magic of this PR (that took me way too long to figure out) comes from adding | packages.NeedDeps to the packages.Load Config. That lets us get the Fset and Syntax of all packages the current package imports. We can then use that information to pull out the anchors for every element we link to.

This also fixes an issue where we were handling some packages that didn't have the Module field set -- we can ignore them. It appears to be a new package gets returned with the ID of the glob you asked for. For example, cloud.google.com/go/.... We don't seem to need that.

Fixes #3739.

@tbpg tbpg requested a review from codyoss March 3, 2021 15:21
@tbpg tbpg requested a review from a team as a code owner March 3, 2021 15:21
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 3, 2021
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@tbpg tbpg added the automerge Merge the pull request once unit tests and other checks pass. label Mar 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 77f76ed into master Mar 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the xref-domain branch March 3, 2021 15:52
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

godocfx: link cross references to same domain when needed
2 participants