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 2 commits into from Mar 3, 2021


Copy link

@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, We don't seem to need that.

Fixes #3739.

@tbpg tbpg requested a review from codyoss Mar 3, 2021
@tbpg tbpg requested a review from googleapis/yoshi-go-admins as a code owner Mar 3, 2021
@google-cla google-cla bot added the cla: yes label Mar 3, 2021
codyoss approved these changes Mar 3, 2021
Copy link

@codyoss codyoss left a comment

Nice, LGTM!

@tbpg tbpg added the automerge label Mar 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 77f76ed into master Mar 3, 2021
3 checks passed
3 checks passed
cla/google All necessary CLAs are signed
kokoro Kokoro CI build successful
@gcf-merge-on-green gcf-merge-on-green bot deleted the xref-domain branch Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants