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

Fixes issues when bazel is used alongside cmake #6770

Merged
merged 8 commits into from
Nov 7, 2024

Conversation

LeFrosch
Copy link
Collaborator

Description of this change

If the file already belongs to a cmake project the bazel import fix is also shown by the PSW and if the project is reopend some classes are registered twice.

image

@LeFrosch LeFrosch marked this pull request as ready for review September 19, 2024 13:46
@github-actions github-actions bot added product: CLion CLion plugin awaiting-review Awaiting review from Bazel team on PRs labels Sep 19, 2024
@LeFrosch
Copy link
Collaborator Author

CC @TomatorCZ

@tpasternak
Copy link
Collaborator

@LeFrosch can we move it to base? It's also a problem with non-cmake build tools

#6757

@LeFrosch
Copy link
Collaborator Author

LeFrosch commented Oct 7, 2024

@TomatorCZ PSW for bazel seems broken in 243 not sure what causes this. As far as I can tell com.google.idea.blaze.clwb.CLionNotificationProvider#getWidgetStatus returns Status.OK but banner is still shown.

@LeFrosch
Copy link
Collaborator Author

LeFrosch commented Oct 7, 2024

@LeFrosch can we move it to base? It's also a problem with non-cmake build tools

#6757

@tpasternak The normal banner is a bit different and only checks if the current project is bazel or not. Also it should be possible to dismiss the default banner.

@tpasternak
Copy link
Collaborator

Sorry I didn't get it

@LeFrosch
Copy link
Collaborator Author

LeFrosch commented Oct 9, 2024

A required fix in CLion is on master - waiting for next EAP due to API changes.

@LeFrosch LeFrosch force-pushed the psw-fix branch 2 times, most recently from 3044283 to 8c5f7f8 Compare October 22, 2024 08:27
@TomatorCZ
Copy link
Contributor

LGTM

Comment on lines 86 to 91
unregisterGenericProvider(project)

if (!providerRegistered) {
registerSpecificProvider();
}
providerRegistered = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's use application service for this thing?

return false
}

if (!isProjectAwareFile(file, project) && file.fileType !== BuildFileType.INSTANCE) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

and this one we need to wrap with read action

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction  or ReadAction; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#498,DefaultDispatcher-worker-42,5,main] 48855694 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#57,AWT-EventQueue-0,6,main] 1293053156
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:218)
	at com.intellij.util.concurrency.ThreadingAssertions.softAssertReadAccess(ThreadingAssertions.java:155)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:921)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:157)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:98)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:267)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.isExcluded(ProjectFileIndexImpl.java:67)
	at com.jetbrains.cidr.project.ui.ProjectStatusHelperKt.isProjectAwareFile(ProjectStatusHelper.kt:18)
	at com.google.idea.blaze.clwb.CLionNotificationProvider.collectFixes(CLionNotificationProvider.kt:46)
	at com.jetbrains.cidr.project.ui.popup.PopupService$Companion$collectFixes$2$1$1.invokeSuspend(PopupService.kt:34)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be fixed by 8c5f7f8?

@ujohnny ujohnny merged commit 8ae4e23 into bazelbuild:master Nov 7, 2024
6 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants