intellij-powershell icon indicating copy to clipboard operation
intellij-powershell copied to clipboard

Frequent hangs when editing code in Rider

Open Timores opened this issue 3 years ago • 4 comments

Rider 2022 (both 2022.1.2 and 2022.2 RC) hangs while one edits PowerShell code (plugin 2.0.10). No need to run the code, just edit it. https://youtrack.jetbrains.com/issue/IDEA-298925/ shows a stack trace.

Timores avatar Jul 29 '22 11:07 Timores

Could you please attach a sample code here which reproduces this for you? Thank you.

ant-druha avatar Jul 29 '22 17:07 ant-druha

Please also make sure the IDE directories (system and config) are excluded from the Windows firewall or antivirus scan.

ant-druha avatar Jul 29 '22 17:07 ant-druha

I had the issue on Friday. I continued working on the file with the PowerShell ISE. When going back to Rider on Tuesday (Monday is a national holiday in Switzerland), I did not have the slowdown issue. I will try with other files and will go back to Friday's version.

Timores avatar Aug 03 '22 07:08 Timores

Get-AssociatedWorkItems.zip This is the file I was working on. The version of the day where I was having the issue. But I can no longer reproduce it.

Timores avatar Aug 05 '22 08:08 Timores

This issue still persists for me. IDE directories are excluded from windows firewall. For some reason it consistently hangs while typing Register-PackageSource. The code example below already causes the issue for me personally.

function Test-LaggingCode {
    param ()
    begin {}
    process {
        # Having the plugin do its magic while typing the line below will cause the editor to lag and/or freeze all together. 
        Register-PackageSource -Name $feedKey -Location $feedValue -ProviderName $providerName -ConfigFile $configFileLocation -SkipValidate;
        
    }
    end {}
}

Export-ModuleMember -Function Test-LaggingCode;

My rider version is 2022.3.2 Powershell plugin version 2.0.10.

I also came across this while skipping through the idea.log.

2023-02-08 08:30:21,405 [  43639]   WARN - #c.i.c.d.i.AnnotationHolderImpl - 'AnnotationHolder.createInfoAnnotation()' method (the call to which was found in class com.intellij.plugin.powershell.lang.PowerShellAnnotator) is slow, non-incremental and thus can cause unexpected behaviour (e.g. annoying blinking), is deprecated and will be removed soon. Please use `newAnnotation(...).create()` instead [Plugin: com.intellij.plugin.adernov.powershell]
com.intellij.diagnostic.PluginException: 'AnnotationHolder.createInfoAnnotation()' method (the call to which was found in class com.intellij.plugin.powershell.lang.PowerShellAnnotator) is slow, non-incremental and thus can cause unexpected behaviour (e.g. annoying blinking), is deprecated and will be removed soon. Please use `newAnnotation(...).create()` instead [Plugin: com.intellij.plugin.adernov.powershell]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:92)
	at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.doCreateAnnotation(AnnotationHolderImpl.java:191)
	at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.createInfoAnnotation(AnnotationHolderImpl.java:126)
	at com.intellij.plugin.powershell.lang.PowerShellAnnotator.createInfoAnnotation(PowerShellAnnotator.kt:70)
	at com.intellij.plugin.powershell.lang.PowerShellAnnotator.annotateMemberAccess(PowerShellAnnotator.kt:58)
	at com.intellij.plugin.powershell.lang.PowerShellAnnotator.annotate(PowerShellAnnotator.kt:26)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:131)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:108)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:344)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$7(GeneralHighlightingPass.java:283)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:304)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$8(GeneralHighlightingPass.java:307)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:93)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:307)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:274)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:222)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:97)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:379)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:371)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:370)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:346)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:173)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:344)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.intellij.util.IncorrectOperationException: 'AnnotationHolder.createInfoAnnotation()' method (the call to which was found in class com.intellij.plugin.powershell.lang.PowerShellAnnotator) is slow, non-incremental and thus can cause unexpected behaviour (e.g. annoying blinking), is deprecated and will be removed soon. Please use `newAnnotation(...).create()` instead
	... 36 more

joshmar avatar Feb 08 '23 07:02 joshmar

#150 fixes both available stacks with freezes (and other potential problems). To my surprise, it turns out that the LSP client implementation we were using was doing blocking IO under the covers; this is no longer an issue.

The warning from @joshmar's comment is already reported as #86 and fixed.

ForNeVeR avatar Oct 01 '23 15:10 ForNeVeR