"Frozen" syntax colouring and Inspections


Since a couple of weeks, syntax colouring and inspections sometimes don't update correctly in CoffeeScript (WebStorm 2017.1).

Please see image for an example. In that case I commented lines 80-115 but some words remain in their previous colour. Same thing happens with code inspections, e.g. the red underline indicating a syntax error will "stick" even after the error is fixed. 

It happens several times an hour. Sometimes the issues resolves itself after a few seconds to a few minutes, otherwise I have to cut then re-paste the code to get the right colouring. (Clicking / Scrolling / Saving / Closing file / etc. don't do anything).


[image deleted]

Comment actions Permalink

Please try invalidating caches (File | Invalidate caches, restart) - does the problem persist?

Comment actions Permalink

Will try, thanks

Comment actions Permalink

Unfortunately the problem is still there...

Comment actions Permalink

strange - usually such issues indicate broken indexes and are cured by caches invalidation.. please can you recreate the issue and attach your idea.log (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files)?

Comment actions Permalink

Ok the logs get filled (> 10MB per hour) with the following error at least every time I'm pressing a key (in this case right after commenting some lines, which produced my syntax colouring bug). Could the bug be a side-effect of a performance issue related to the below ? It actually feels like it resolves itself quicker after I cleared the cache or after I restart the IDE... (PS. how can I attach the full file ? It says "You can only upload images" when I drag it here)


2017-05-24 17:21:45,187 [ 153844] ERROR - aemon.impl.PassExecutorService - Language: RegExp != Language: JSRegexp
java.lang.AssertionError: Language: RegExp != Language: JSRegexp
at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:47)
at org.intellij.lang.regexp.RegExpFile.<init>(RegExpFile.java:32)
at org.intellij.lang.regexp.RegExpParserDefinition.createFile(RegExpParserDefinition.java:129)
at com.intellij.psi.impl.source.tree.injected.MultiHostRegistrarImpl.doneInjecting(MultiHostRegistrarImpl.java:230)
at com.intellij.lang.javascript.JSLanguageInjector.injectRegex(JSLanguageInjector.java:153)
at org.coffeescript.lang.injection.CoffeeScriptInjector.getLanguagesToInject(CoffeeScriptInjector.java:51)
at com.intellij.psi.impl.source.tree.injected.InjectedPsiCachedValueProvider$MyInjProcessor.process(InjectedPsiCachedValueProvider.java:82)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:459)
at com.intellij.psi.impl.source.tree.injected.InjectedPsiCachedValueProvider.doCompute(InjectedPsiCachedValueProvider.java:62)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.probeElementsUp(InjectedLanguageUtil.java:314)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.enumerate(InjectedLanguageUtil.java:146)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:238)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:200)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.a(LineMarkersPass.java:116)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1153)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
2017-05-24 17:21:45,189 [ 153846] ERROR - aemon.impl.PassExecutorService - WebStorm 2017.1.1 Build #WS-171.4073.40
2017-05-24 17:21:45,189 [ 153846] ERROR - aemon.impl.PassExecutorService - JDK: 1.8.0_112-release
2017-05-24 17:21:45,189 [ 153846] ERROR - aemon.impl.PassExecutorService - VM: OpenJDK 64-Bit Server VM
2017-05-24 17:21:45,189 [ 153846] ERROR - aemon.impl.PassExecutorService - Vendor: JetBrains s.r.o
2017-05-24 17:21:45,189 [ 153846] ERROR - aemon.impl.PassExecutorService - OS: Mac OS X
2017-05-24 17:21:45,189 [ 153846] ERROR - aemon.impl.PassExecutorService - Last Action: CommentByLineComment

Comment actions Permalink

This error can indeed result in broken highlighting... Looks like an invalid regexp language injection.

Can you share a project/file(s) I can use to recreate the issue?

You can upload them to some file server and provide a link, or create a support ticket if you would like to keep it private

Comment actions Permalink

I've been able to reproduce the regexp bug in an empty project so it seems like a general problem. (I'm still unsure it's linked to my syntax colouring bug though).

Here's the project and log file: http://s000.tinyupload.com/?file_id=00722749523301154741.

Do you get the bug too ?

Comment actions Permalink

Unfortunately I can't recreate the issue in #WS-171.4424 using provided project... No exceptions are thrown, and highlighting seems to be fine.

Please try the following:

- make sure to close all your projects

- shut down WebStorm

- delete the idea.log file (or, better, the whole log folder)

- start WebStorm, open 'CoffeeScript Regexp bug' project (the one you sent to me) - does the problem persist?

If yes, can you check if upgrading to the most recent 2017.1 build helps?


Comment actions Permalink

The problem is still there. Did you activate the CoffeeScript plugin? That's where the problem comes from I believe: if I disable it, everything is fine (except of course no syntax colouring etc.). As soon as I re-enable it, the exception gets thrown and the Code analysis for the regexp file never completes (see image below). My CoffeeScript plugin version is 2.0.

I did the following steps together: - Invalidate Caches - Close projects - Shut down WebStorm - Deleted whole log folder - Deleted whole general options folder (~/Library/Preferences/WebStorm2017.1/options) - Updated to #WS-171.4424.63 - Reopened the project I sent you. Bug.

Comment actions Permalink

>Did you activate the CoffeeScript plugin?

sure it's active

Please provide a new idea.log (created when only the project you sent is opened, no other projects) plus your settings (File | Export settings, or zip the whole `~/Library/Preferences/WebStorm2017.1` folder)

Comment actions Permalink

There you go: http://s000.tinyupload.com/?file_id=50452955563080590195.

- Closed all projects and webstorm - Cleared log folder - Opened webstorm - Opened attached project - Exported settings - Closed project and webstorm.


Comment actions Permalink

Weird... Even with your settings + plugins, everything still works good for me:

Please try deleting all your settings and caches:

rm -rf “~/Library/Preferences/WebStorm2017.1″
rm -rf “~/Library/Caches/WebStorm2017.1″
rm -rf “~/Library/Application Support/WebStorm2017.1″
rm -rf “~/Library/Logs/WebStorm2017.1″

is the issue still there?

Comment actions Permalink

Finally works again!

Deleting my preferences folder solved it, in particular the file disabled_plugins.txt.

And I singled out the issue, on my system at least: It's disabling the plugin IntelliLang 8.0 while the plugin CoffeeScript 2.0 is active that throws the exception (which makes sense now since the exception message mentions language injections). This has solved the syntax colouring and code analysis bugs too :) You should consider adding a dependency between these two plugins...

Thanks for your help,


Comment actions Permalink

Great, thanks for update! We had similar exception reported against Dart, and had to idea how to proceed:)

Comment actions Permalink

faced a similar issue with dart, i refreshed the caches restarted my IDE but to no resolve. Then i uninstalled some garbage plugins and restarted my IDE and it worked like magic. Thanks a ton.


Please sign in to leave a comment.