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

fix(qsync): External modules navigation in starlark files #7213

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sellophane
Copy link
Collaborator

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

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

Copy link

google-cla bot commented Jan 7, 2025

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.

@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Jan 7, 2025
@sellophane sellophane force-pushed the qsync-external-navigation branch from 412de37 to 226bd6b Compare January 7, 2025 12:59
Copy link
Collaborator

@LeFrosch LeFrosch left a 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:

2025-01-14 15:44:41,226 [ 9571] WARN - #com.google.idea.blaze.base.qsync.QuerySyncProjectData - For input string: "2417d589900c4179277e13fa61edc134d473446d" java.lang.NumberFormatException: For input string: "2417d589900c4179277e13fa61edc134d473446d" at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) at java.base/java.lang.Long.parseLong(Long.java:709) at java.base/java.lang.Long.parseLong(Long.java:832) at com.google.idea.blaze.base.qsync.QuerySyncProjectData.lambda$getBlazeVersionData$5(QuerySyncProjectData.java:156) at java.base/java.util.Optional.ifPresent(Optional.java:178) at com.google.idea.blaze.base.qsync.QuerySyncProjectData.getBlazeVersionData(QuerySyncProjectData.java:153) at com.google.idea.blaze.base.sync.aspects.strategy.AspectRepositoryProvider.lambda$getOverrideFlags$2(AspectRepositoryProvider.java:49) at java.base/java.util.Optional.map(Optional.java:260) at com.google.idea.blaze.base.sync.aspects.strategy.AspectRepositoryProvider.getOverrideFlags(AspectRepositoryProvider.java:49) at com.google.idea.blaze.base.sync.aspects.AspectBuildFlagsProvider.addSyncFlags(AspectBuildFlagsProvider.java:36) at com.google.idea.blaze.base.command.BlazeFlags.blazeFlags(BlazeFlags.java:85) at com.google.idea.blaze.base.bazel.AbstractBuildInvoker.runBlazeInfo(AbstractBuildInvoker.java:142) at com.google.idea.blaze.base.bazel.AbstractBuildInvoker.getBlazeInfoResult(AbstractBuildInvoker.java:121) at com.google.idea.blaze.base.bazel.AbstractBuildInvoker.getBlazeInfo(AbstractBuildInvoker.java:115) at com.google.idea.blaze.base.model.ExternalWorkspaceSyncListener.onSyncComplete(ExternalWorkspaceSyncListener.java:66) at com.google.idea.blaze.base.qsync.QuerySyncProject.sync(QuerySyncProject.java:282) at com.google.idea.blaze.base.qsync.QuerySyncManager.loadProject(QuerySyncManager.java:188) at com.google.idea.blaze.base.qsync.QuerySyncManager.lambda$createAndSubmitRunTask$2(QuerySyncManager.java:383) at com.google.idea.blaze.base.scope.Scope.push(Scope.java:40) at com.google.idea.blaze.base.scope.Scope.root(Scope.java:28) at com.google.idea.blaze.base.qsync.QuerySyncManager.lambda$createAndSubmitRunTask$3(QuerySyncManager.java:368) at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTaskWithResult$3(ProgressiveTaskWithProgressIndicator.java:111) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82) at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101) at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101) at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107) at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101) at com.intellij.util.concurrency.ContextRunnable.run$$$capture(ContextRunnable.java:27) at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java) at --- Async.Stack.Trace --- (captured by IntelliJ IDEA debugger) at com.intellij.util.concurrency.ContextRunnable.(ContextRunnable.java:15) at com.intellij.util.concurrency.Propagation.capturePropagationContext(propagation.kt:326) at com.intellij.util.concurrency.AppScheduledExecutorService.capturePropagationAndCancellationContext(AppScheduledExecutorService.java:235) at com.intellij.util.concurrency.BoundedTaskExecutor.execute(BoundedTaskExecutor.java:151) at com.google.common.util.concurrent.MoreExecutors$ListeningDecorator.execute(MoreExecutors.java:532) at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:79) at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.submitTaskWithResult(ProgressiveTaskWithProgressIndicator.java:111) at com.google.idea.blaze.base.qsync.QuerySyncManager.createAndSubmitRunTask(QuerySyncManager.java:366) at com.google.idea.blaze.base.qsync.QuerySyncManager.run(QuerySyncManager.java:347) at com.google.idea.blaze.base.qsync.QuerySyncManager.runSync(QuerySyncManager.java:309) at com.google.idea.blaze.base.qsync.QuerySyncManager.onStartup(QuerySyncManager.java:241) at com.google.idea.blaze.base.sync.BlazeSyncStartupActivity.runActivity(BlazeSyncStartupActivity.java:46) at com.intellij.ide.startup.impl.StartupManagerImpl.runOldActivity(StartupManagerImpl.kt:337) at com.intellij.ide.startup.impl.StartupManagerImpl.doRunPostStartupActivities$lambda$4$lambda$3(StartupManagerImpl.kt:288) at com.intellij.openapi.progress.CoroutinesKt.blockingContextInner(coroutines.kt:341) at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invokeSuspend(coroutines.kt:233) at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt) at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62) at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261) at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:232) at com.intellij.ide.startup.impl.StartupManagerImpl.doRunPostStartupActivities(StartupManagerImpl.kt:287) at com.intellij.ide.startup.impl.StartupManagerImpl.access$doRunPostStartupActivities(StartupManagerImpl.kt:70) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3$2.invokeSuspend(StartupManagerImpl.kt:196) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3$2.invoke(StartupManagerImpl.kt) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3$2.invoke(StartupManagerImpl.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$3.invokeSuspend(StartupManagerImpl.kt:195) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith$$$capture(ContinuationImpl.kt:33) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt) at --- Async.Stack.Trace --- (captured by IntelliJ IDEA debugger) at kotlinx.coroutines.debug.internal.DebugProbesImpl$CoroutineOwner.(DebugProbesImpl.kt:531) at kotlinx.coroutines.debug.internal.DebugProbesImpl.createOwner(DebugProbesImpl.kt:510) at kotlinx.coroutines.debug.internal.DebugProbesImpl.probeCoroutineCreated$kotlinx_coroutines_core(DebugProbesImpl.kt:497) at kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineCreated(DebugProbesKt.java:12) at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:161) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:21) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:88) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123) at kotlinx.coroutines.BuildersKt__Builders_commonKt.async(Builders.common.kt:87) at kotlinx.coroutines.BuildersKt.async(Unknown Source) at kotlinx.coroutines.BuildersKt__Builders_commonKt.async$default(Builders.common.kt:78) at kotlinx.coroutines.BuildersKt.async$default(Unknown Source) at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.kt:188) at com.intellij.openapi.project.impl.ProjectManagerImpl.doOpenAsync(ProjectManagerImpl.kt:753) at com.intellij.openapi.project.impl.ProjectManagerImpl.access$doOpenAsync(ProjectManagerImpl.kt:101) at com.intellij.openapi.project.impl.ProjectManagerImpl$doOpenAsync$1.invokeSuspend(ProjectManagerImpl.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith$$$capture(ContinuationImpl.kt:33) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt) at --- Async.Stack.Trace --- (captured by IntelliJ IDEA debugger) at kotlinx.coroutines.debug.internal.DebugProbesImpl$CoroutineOwner.(DebugProbesImpl.kt:531) at kotlinx.coroutines.debug.internal.DebugProbesImpl.createOwner(DebugProbesImpl.kt:510) at kotlinx.coroutines.debug.internal.DebugProbesImpl.probeCoroutineCreated$kotlinx_coroutines_core(DebugProbesImpl.kt:497) at kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineCreated(DebugProbesKt.java:12) at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:161) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:21) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:88) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:123) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:52) at kotlinx.coroutines.BuildersKt.launch(Unknown Source) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:43) at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source) at com.intellij.openapi.wm.impl.welcomeScreen.recentProjects.RecentProjectItem$Companion.openProjectAndLogRecent(RecentProjectTreeItem.kt:64) at com.intellij.ide.ReopenProjectAction.actionPerformed(ReopenProjectAction.kt:100) at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:374) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks$lambda$7(ActionUtil.kt:343) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1173) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.kt:342) at com.intellij.ui.popup.ActionPopupStep.performActionItem(ActionPopupStep.java:300) at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$3(ActionPopupStep.java:268) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$21(AbstractPopup.java:1820) at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916) at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55) at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23) at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$4(FocusManagerImpl.java:178) at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:32) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:1303) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:173) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:165) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1818) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:170) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:404) at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:131) at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:163) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:193) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:278) at com.intellij.ui.popup.list.ListPopupImpl.disposePopup(ListPopupImpl.java:536) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:560) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:521) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:446) at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:786) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6662) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3394) at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:851) at java.desktop/java.awt.Component.processEvent(Component.java:6427) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5032) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4860) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4963) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4577) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4518) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2810) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4860) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:783) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:755) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:753) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:752) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:621) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$21(IdeEventQueue.kt:564) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:564) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045) at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916) at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55) at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2(IdeEventQueue.kt:1045) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:117) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop

But overall navigation to external dependencies seems to be working.

base/src/META-INF/blaze-base.xml Show resolved Hide resolved
Comment on lines +21 to +35
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;
}
}
Copy link
Collaborator

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?

@sellophane
Copy link
Collaborator Author

What bazel version have you tested it on? For 8.0.0 I have no upstreamRevision value so the error you mentioned is not showing up

@sellophane sellophane force-pushed the qsync-external-navigation branch from 226bd6b to f421691 Compare January 22, 2025 14:42
@sellophane sellophane force-pushed the qsync-external-navigation branch 2 times, most recently from 12cbc92 to 2fc8bca Compare January 22, 2025 16:48
@sellophane sellophane force-pushed the qsync-external-navigation branch from 2fc8bca to 0403b21 Compare January 22, 2025 16:49
@sellophane sellophane requested a review from LeFrosch January 22, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Awaiting review from Bazel team on PRs product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

4 participants