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

indexer: Account for module calls pointing outside of the workspace #1000

Closed
wants to merge 2 commits into from

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Jul 13, 2022

Background

Fixes #996

I originally started this PR as an attempt to fix a race condition where origins for parent module are collected too early (before the submodule metadata decoding) which causes go-to-definition to not work at first load, but later realized that a reliable fix for that will require us to stop de-duplicating jobs, which in turn will require some other changes, so I created #1002 instead to track that work.

UX Before (on first load)

2022-07-18 08 09 22

UX After (on first load)

2022-07-18 08 05 58

@radeksimko radeksimko added the enhancement New feature or request label Jul 13, 2022
@radeksimko radeksimko self-assigned this Jul 13, 2022
@radeksimko radeksimko force-pushed the f-recollect-origins-from-callers branch 2 times, most recently from a54fe37 to 00936de Compare July 14, 2022 09:23
@radeksimko radeksimko changed the title WIP: Re-collect reference origins for indexed module callers Re-collect reference origins for indexed module callers Jul 14, 2022
@radeksimko radeksimko force-pushed the f-recollect-origins-from-callers branch 2 times, most recently from 1294a30 to ea18a9c Compare July 14, 2022 11:21
@radeksimko radeksimko changed the title Re-collect reference origins for indexed module callers Enable go-to-definition for local uninitialized modules (on first indexing run) Jul 14, 2022
@radeksimko radeksimko marked this pull request as ready for review July 14, 2022 12:22
@radeksimko radeksimko requested a review from a team as a code owner July 14, 2022 12:22
@radeksimko radeksimko linked an issue Jul 14, 2022 that may be closed by this pull request
2 tasks
@radeksimko radeksimko marked this pull request as draft July 14, 2022 12:33
@radeksimko radeksimko force-pushed the f-recollect-origins-from-callers branch 3 times, most recently from 2044b5d to 56629c1 Compare July 15, 2022 10:52
@radeksimko radeksimko force-pushed the f-recollect-origins-from-callers branch from 56629c1 to cca874e Compare July 18, 2022 06:51
@radeksimko radeksimko changed the title Enable go-to-definition for local uninitialized modules (on first indexing run) indexer: Account for module calls pointing outside of the workspace Jul 18, 2022
@radeksimko radeksimko marked this pull request as ready for review July 18, 2022 07:15
@radeksimko radeksimko added this to the v0.29.0 milestone Jul 18, 2022
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

Works! 👍 Just a small question

@@ -68,6 +69,16 @@ func (idx *Indexer) decodeModule(ctx context.Context, modHandle document.DirHand
Type: op.OpTypeLoadModuleMetadata.String(),
Defer: func(ctx context.Context, jobErr error) (job.IDs, error) {
ids := make(job.IDs, 0)

var errs *multierror.Error
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to return this further down?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch! 😅

@radeksimko
Copy link
Member Author

Closing as per our conversation on Slack, summarized in #996 (comment)

@radeksimko radeksimko closed this Jul 18, 2022
@radeksimko radeksimko deleted the f-recollect-origins-from-callers branch July 18, 2022 12:32
@radeksimko radeksimko removed this from the v0.29.0 milestone Jul 18, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Account for module calls pointing outside of the workspace
2 participants