"Performing code analysis" stuck

Answered

Weather am I switching between different brunches or just trying to save a file, "Performing code analysis" window appears on the screen.

It just never ends, analyzing somewhat in different files. Cancel button doesn't help much.

Tell me please, how to disable it.

 

12 comments
Comment actions Permalink

Hello, please tell if the issue is reproduced for you with 2019.3 (https://www.jetbrains.com/idea/nextversion/)? Please share the idea.log file (Help | Show Log in Finder) and thread dump (https://intellij-support.jetbrains.com/hc/en-us/articles/206544899-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond).

Thank you 

0
Comment actions Permalink

Similar issue, code analysis gets stuck in 2019.3 in the following situation:

php source line:

    $sql = preg_replace('/\$'.($var).'(?!\d)/', $vx, $sql);

 

No visible error appears, only the "indexing files" never finish, and no code analysing results in the editor.

Workaround: after replacing the affected source line to the following, the code analysis runs normally:

$pattern = '~\$'.($var).'(?!\d)~';
$sql = preg_replace($pattern, $vx, $sql);

idea.log:

2019-12-15 17:46:22,477 [4398768] ERROR - aemon.impl.PassExecutorService - @`'/\$'.($var).'(?!\d)/'` Language: PhpRegExp
java.lang.RuntimeException: @`'/\$'.($var).'(?!\d)/'` Language: PhpRegExp
at com.jetbrains.php.injection.PhpInjectionUtil.registerStringLiteralInjection(PhpInjectionUtil.java:130)
at com.jetbrains.php.injection.PhpInjectorBase.registerInjection(PhpInjectorBase.java:55)
at com.jetbrains.php.injection.PhpInjectorBase.getLanguagesToInject(PhpInjectorBase.java:25)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:431)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.probeElementsUp(InjectedLanguageUtil.java:341)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.enumerate(InjectedLanguageUtil.java:166)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerateEx(InjectedLanguageManagerImpl.java:330)
at com.intellij.codeInsight.daemon.impl.InjectedGeneralHighlightingPass.lambda$getInjectedPsiFiles$3(InjectedGeneralHighlightingPass.java:184)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:148)
at com.intellij.concurrency.ApplierCompleter.tryToExecAllList(ApplierCompleter.java:227)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:155)
at com.intellij.concurrency.ApplierCompleter.tryToExecAllList(ApplierCompleter.java:227)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:155)
at com.intellij.concurrency.ApplierCompleter.tryToExecAllList(ApplierCompleter.java:227)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:155)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:992)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:116)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:157)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.helpCC(ForkJoinPool.java:1115)
at java.base/java.util.concurrent.ForkJoinPool.awaitJoin(ForkJoinPool.java:1687)
at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1039)
at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:58)
at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:45)
at com.intellij.codeInsight.daemon.impl.InjectedGeneralHighlightingPass.getInjectedPsiFiles(InjectedGeneralHighlightingPass.java:180)
at com.intellij.codeInsight.daemon.impl.InjectedGeneralHighlightingPass.collectInformationWithProgress(InjectedGeneralHighlightingPass.java:87)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:55)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:429)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:997)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:422)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:421)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:397)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:157)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:395)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:161)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.lang.RuntimeException: After patch: doc:
'\$%name(?!\d)'
---PSI:
'%name(?!\d)'
---chars:
'%name(?!\d)'.
OK let's see. Host file: PHP file in 'D:\data\www\uapp\lib\DBX.php' (Language: PHP)
Was injected Language: PhpRegExp at ranges: [Shred suffix='%name' in StringLiteralExpressionImpl: '/\\$' with range (16357,16362) (class com.jetbrains.php.lang.psi.elements.impl.StringLiteralExpressionImpl) inside range (2,4), Shred in StringLiteralExpressionImpl: '(?!\\d)/' with range (16370,16379) (class com.jetbrains.php.lang.psi.elements.impl.StringLiteralExpressionImpl) inside range (1,7)]
at com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.parseFile(InjectionRegistrarImpl.java:703)
at com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.createAndRegisterInjected(InjectionRegistrarImpl.java:255)
at com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.doneInjecting(InjectionRegistrarImpl.java:220)
at com.jetbrains.php.injection.PhpInjectionUtil.processElement(PhpInjectionUtil.java:176)
at com.jetbrains.php.injection.PhpInjectionUtil.registerStringLiteralInjection(PhpInjectionUtil.java:124)
... 52 more

0
Comment actions Permalink

@Uherkovich Peter 

Thanks for reporting the issue, I have managed to reproduce it on PhpStorm 2019.3 RC with your code example and reported it on our tracker, please follow:

https://youtrack.jetbrains.com/issue/WI-50358

0
Comment actions Permalink

I also have a similar issue with IntelliJ 2019.3. I'm working on a spring boot project and have been changing a method for a REST Controller.

First its return type has been

public ResponseEntity<Integer> ...

And the last line of the method has been (some number)

return ResponseEntity.ok(1337);
ok method signature:
public static <T> ResponseEntity<T> ok(T body)

I then first changed the return type to (in header)

public ResponseEntity<UploadInformation> ...

And expected IntelliJ to show me an error because the method still returned ResponseEntity<Integer>. However the analysis did not finish and "the eye" in the top right corner of the editor got stuck there.. (instead of showing a red cube). Returning the correct type also didn't resolve this. An important note might be that I have been working on (the constructors of) UploadInformation (which is a nested class in the same class where the method lives). 

I restarted IntelliJ and invalidated caches, did not help as well.

 

However I simply changed the code further and removed constructors from the UploadInformation class which then resolved the issue. Unfortunately I cannot reproduce the error.

I suspect that IntelliJ got stuck with its analysis during resolving the generic type of ResponseEntity<UploadInformation> while I have been changing the UploadInformation (nested) class at the same time. Remember that ok(T Body) takes a generic type T and IntelliJ has to check if this generic type T which is also returned is compatible to the one which should be returned by the method (according to the header of the method).

tl;dr changed method return type in header of method but not in body which got the code analysis stuck and didn't resolve as I changed to the correct return type. New return type is a nested class (same class as mentioned method), old one was Integer. Somehow resolved it

Please tell me if you need more information and if I should try again to reproduce it.

0
Comment actions Permalink

Hello,

If possible please check if the issue is reproduced for you with IntelliJ IDEA 2019.3.2 (

https://confluence.jetbrains.com/display/IDEADEV/IDEA+2019.3+latest+builds). Please share the idea.log file (Help | Show Log in Finder) in case it is reproduced. Log may be uploaded here: https://uploads.services.jetbrains.com/

Thank you 

0
Comment actions Permalink

I was able to reproduce a similar error with IntelliJ 2019.3.2 (build 193.6015.22). Quick question here: I downloaded IntelliJ from the link you provided and installed it, without uninstalling my previous IntelliJ version first. Now I got two folders, named "IntelliJ IDEA 2019.2.3" and "IntelliJ IDEA 2019.3.2" - only the second folder has an idea.exe in its bin folder. Is this intended (that there are two folders and that the last two numbers are switched)?

Here are the reproduction steps:

1. Correct state

public ResponseEntity<Integer>
return ResponseEntity.ok(1337);

2. Create two identical constructors in UploadInformation (to create an error in this nested class)

3. Change signature of method to

public ResponseEntity<UploadInformation>

and keep

return ResponseEntity.ok(1337);

This is not marked as an error.

 

Revert and repeat steps 1 and 2 (not step 3) so that we have no errors. 

Then step 4:

public ResponseEntity<Integer> // keep header
return ResponseEntity.ok(noPresentUploadInfo); // noPresentUploadInfo is instance of UploadInformation

Now the return type will be marked as an error.

Step 5:

public ResponseEntity<UploadInformation>
return ResponseEntity.ok(noPresentUploadInfo);

This is correct (not marked as error too)

Step 6:

public ResponseEntity<UploadInformation>
return ResponseEntity.ok(1337);

This is marked as an error again (which is the same as step 3 however step 3 is not marked as error).

 

First of, I am not quite sure if this is the exact same error which I had yesterday because in the top right corner of the editor "the eye" remains as an icon (not a red square) however when I hover my mouse over the symbol it shows that there are 3 errors and 3 warnings (yesterday it might have been showing that it is still loading, not sure though). Anyway, those three errors are because of the two identical constructors in UploadInformation and the one time I use the constructor inside the method body. These are also marked on the right side of the editor. 

What is not marked though (IntelliJ does not show this error anywhere), is the incorrect return type (step 3 only) which is an additional error.

 

Obviously there are errors in the type UploadInformation so my guess is that IntelliJ might not continue to check if the generic types of the method header and return type are compatible. I do not know if this is intended or not but UploadInformation is obviously not an Integer. 

And what is even more interesting is that the exact same code once produces an error (step 6) and once not (step 3) depending on the order of changing headers and return types.

I uploaded two log files, the idea_errorstate.log has been saved directly after step 3 and the other one ( idea_fixedstate.log ) as soon as I removed errors and changed the method header/return type (in some random order, not necessarily steps 4 - 6).

0
Comment actions Permalink

2019.2.3 is the previous version of IntelliJ IDEA, 2019.3.2 is the current Preview build, both folders should contain exe files.

Please clarify how do you install the new versions, via ToolBox or manually?

 

Is the current issue still reproduced for you in case you disable all custom plugins and Kotlin plugin? 

If possible please create the bugs at YouTrack for both of the issues (https://youtrack.jetbrains.com/issues/IDEA). Please attach to the issue the little sample project where the issue with wrong highlighting is reproduced for you. Thank you.

0
Comment actions Permalink

I had Intellij 2019.2.3 installed and until recently I used the included updater for updates. Then I downloaded the version from the link you provided and installed the new IntelliJ version without previously deleting the old version.

Unfortunately, I currently do not find the time to neither de/re-install IntelliJ nor to create a small sample project (I didn't disable any plugins either), sorry.

0
Comment actions Permalink

I have just experienced something similar on 2020.2.3 (Ultimate) for a large project. This is just a single tab, where the text in the upper right corner says "Analyzing.." and never returns. I can probably fix by invalidating my indexes - but that is painfully slow.

1
Comment actions Permalink

Please report an issue on YouTrack (https://youtrack.jetbrains.com/issues/IDEA) attaching full logs folder zipped (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files) after restarting IDE and reproducing the issue.

0
Comment actions Permalink

Yaroslav Bedrov I will do that next time it happens :-) 

0
Comment actions Permalink

Thanks in advance!

0

Please sign in to leave a comment.