Error in SonarQube for IntelliJ

Environment:

  • Java: JetBrains s.r.o. 21.0.6
  • OS: Mac OS X aarch64
  • IDE: WebStorm 2025.1.1
  • SonarQube for IDE: 10.24.0.81420
java.lang.IllegalStateException: 'runBlockingCancellable' is forbidden in the Write Action because it may start a long-running computation. This can cause UI freezes.
Consider running this 'runBlockingCancellable' under a read action outside your Write Action'
	at c.ij.oa.progress.CoroutinesKt.assertBackgroundThreadAndNoWriteAction(coroutines.kt:478)
	at c.ij.oa.progress.CoroutinesKt.runBlockingCancellable(coroutines.kt:143)
	at c.ij.oa.progress.CoroutinesKt.runBlockingMaybeCancellable(coroutines.kt:180)
	at c.ij.lang.javascript.service.JSLanguageServiceBase._get_process_$lambda$2(JSLanguageServiceBase.kt:134)
	at c.ij.lang.javascript.service.JSLanguageServiceTracerUtilKt.withServiceTraceSpan(JSLanguageServiceTracerUtil.kt:42)
	at c.ij.lang.javascript.service.JSLanguageServiceTracerUtilKt.withServiceTraceSpan$default(JSLanguageServiceTracerUtil.kt:39)
	at c.ij.lang.javascript.service.JSLanguageServiceBase.getProcess(JSLanguageServiceBase.kt:133)
	at c.ij.prettierjs.PrettierLanguageServiceImpl.format(PrettierLanguageServiceImpl.kt:37)
	at c.ij.prettierjs.ReformatWithPrettierAction.performRequestForFile(ReformatWithPrettierAction.java:375)
	at c.ij.prettierjs.ReformatWithPrettierAction.processFileAsPostFormatProcessor(ReformatWithPrettierAction.java:202)
	at c.ij.prettierjs.PrettierPostFormatProcessor.processText(PrettierPostFormatProcessor.java:32)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessRange(CoreCodeStyleUtil.java:148)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessEnabledRanges(CoreCodeStyleUtil.java:139)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessText(CoreCodeStyleUtil.java:127)
	at c.ij.formatting.service.CoreFormattingService.lambda$formatRanges$0(CoreFormattingService.java:73)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessRanges(CoreCodeStyleUtil.java:115)
	at c.ij.formatting.service.CoreFormattingService.formatRanges(CoreFormattingService.java:73)
	at c.ij.formatting.service.FormattingServiceUtil.formatRanges(FormattingServiceUtil.java:122)
	at c.ij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:164)
	at c.ij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:123)
	at o.sl.ij.editor.ApplyQuickFixIntentionAction.invoke(ApplyQuickFixIntentionAction.kt:85)
	at c.ij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$12(ShowIntentionActionsHandler.java:387)
	at c.ij.oa.ap.WriteAction.lambda$run$1(WriteAction.java:85)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$15(AnyThreadWriteThreadingSupport.kt:623)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:623)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:617)
	at c.ij.oa.ap.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:998)
	at c.ij.oa.ap.WriteAction.run(WriteAction.java:84)
	at c.ij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:387)
	at c.ij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$10(ShowIntentionActionsHandler.java:338)

Hi @blood0cean

Do you have a reproducer code example?

I created this ticket for the fix.

Environment:

  • Java: JetBrains s.r.o. 21.0.7
  • OS: Mac OS X aarch64
  • IDE: WebStorm 2025.1.2
  • SonarQube for IDE: 10.24.0.81420
java.lang.IllegalStateException: 'runBlockingCancellable' is forbidden in the Write Action because it may start a long-running computation. This can cause UI freezes.
Consider running this 'runBlockingCancellable' under a read action outside your Write Action'
	at c.ij.oa.progress.CoroutinesKt.assertBackgroundThreadAndNoWriteAction(coroutines.kt:478)
	at c.ij.oa.progress.CoroutinesKt.runBlockingCancellable(coroutines.kt:143)
	at c.ij.oa.progress.CoroutinesKt.runBlockingMaybeCancellable(coroutines.kt:180)
	at c.ij.lang.javascript.service.JSLanguageServiceBase._get_process_$lambda$2(JSLanguageServiceBase.kt:134)
	at c.ij.lang.javascript.service.JSLanguageServiceTracerUtilKt.withServiceTraceSpan(JSLanguageServiceTracerUtil.kt:42)
	at c.ij.lang.javascript.service.JSLanguageServiceTracerUtilKt.withServiceTraceSpan$default(JSLanguageServiceTracerUtil.kt:39)
	at c.ij.lang.javascript.service.JSLanguageServiceBase.getProcess(JSLanguageServiceBase.kt:133)
	at c.ij.prettierjs.PrettierLanguageServiceImpl.format(PrettierLanguageServiceImpl.kt:37)
	at c.ij.prettierjs.ReformatWithPrettierAction.performRequestForFile(ReformatWithPrettierAction.java:375)
	at c.ij.prettierjs.ReformatWithPrettierAction.processFileAsPostFormatProcessor(ReformatWithPrettierAction.java:202)
	at c.ij.prettierjs.PrettierPostFormatProcessor.processText(PrettierPostFormatProcessor.java:32)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessRange(CoreCodeStyleUtil.java:148)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessEnabledRanges(CoreCodeStyleUtil.java:139)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessText(CoreCodeStyleUtil.java:127)
	at c.ij.formatting.service.CoreFormattingService.lambda$formatRanges$0(CoreFormattingService.java:73)
	at c.ij.psi.impl.source.codeStyle.CoreCodeStyleUtil.postProcessRanges(CoreCodeStyleUtil.java:115)
	at c.ij.formatting.service.CoreFormattingService.formatRanges(CoreFormattingService.java:73)
	at c.ij.formatting.service.FormattingServiceUtil.formatRanges(FormattingServiceUtil.java:122)
	at c.ij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:164)
	at c.ij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:123)
	at o.sl.ij.editor.ApplyQuickFixIntentionAction.invoke(ApplyQuickFixIntentionAction.kt:85)
	at c.ij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$12(ShowIntentionActionsHandler.java:387)
	at c.ij.oa.ap.WriteAction.lambda$run$1(WriteAction.java:85)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$15(AnyThreadWriteThreadingSupport.kt:623)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:623)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:617)
	at c.ij.oa.ap.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:998)
	at c.ij.oa.ap.WriteAction.run(WriteAction.java:84)
	at c.ij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:387)
	at c.ij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$10(ShowIntentionActionsHandler.java:338)