-
Notifications
You must be signed in to change notification settings - Fork 312
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
fix(qsync): External modules navigation in starlark files #7213
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
412de37
to
226bd6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After running ij with these changes I see many of these exceptions:
But overall navigation to external dependencies seems to be working.
|
||
public class ExternalWorkspaceSyncListener implements SyncListener { | ||
@Override | ||
public void onSyncComplete(Project project, BlazeContext context, BlazeImportSettings importSettings, ProjectViewSet projectViewSet, ImmutableSet<Integer> buildIds, BlazeProjectData blazeProjectData, SyncMode syncMode, SyncResult syncResult) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong formatting.
); | ||
ExternalWorkspaceDataManager.getInstance(project).setData(data); | ||
} catch (SyncCanceledException | SyncFailedException e) { | ||
throw new RuntimeException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this can fail, can we make this a sync step instead of a listener?
@@ -260,6 +260,7 @@ | |||
<projectService serviceInterface="com.google.idea.blaze.base.sync.data.BlazeProjectDataManager" | |||
serviceImplementation="com.google.idea.blaze.base.sync.data.DelegatingBlazeProjectDataManager"/> | |||
<projectService serviceImplementation="com.google.idea.blaze.base.sync.BlazeSyncManager"/> | |||
<projectService serviceImplementation="com.google.idea.blaze.base.model.ExternalWorkspaceDataManager"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ujohnny @Service
is preferred over registration in the plugin.xml
file?
public class ExternalWorkspaceDataManager { | ||
private ExternalWorkspaceData data; | ||
|
||
public static ExternalWorkspaceDataManager getInstance(Project project) { | ||
return project.getService(ExternalWorkspaceDataManager.class); | ||
} | ||
|
||
public ExternalWorkspaceData getData(){ | ||
return data; | ||
} | ||
|
||
public void setData(ExternalWorkspaceData data) { | ||
this.data = data; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for creating this service instead of just implementing the field for QuerySyncProjectData
too?
|
||
BlazeInfo getBazelInfo() throws BuildException { | ||
try { | ||
return buildInvoker.getBlazeInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting is wrong here too, as far as I know we are following this code style.
Checklist
Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.
Discussion thread for this change
Issue number:
<please reference the issue number or url here>
Description of this change