最近,我将intelliJ从2018年的一个版本升级到了当前的版本,现在,检查语法突出显示不太可靠。
当我开始键入一些东西,例如一个任务时,我会在开始时得到一个检查警告。
field.value =
结果在Expression statement is not an assignment or call中是显而易见的,因为我还没有完成这项任务。

但是,当我输入完赋值时,检查不会发现这是一个有效的赋值,语法高亮显示也不会消失。

如果我简单地高亮显示被检查的部分(field.value),然后将其剪掉并立即粘贴回去,IntelliJ就会识别它是正确编写的,语法高亮显示也就消失了。
上面的例子是关于javascript的,但是这发生在所有的事情上。到处都是。在我的整个项目中,始终有不正确的、过时的语法突出显示,需要剪切和粘贴回来才能正确显示。
下面是在输入字符串时对字符串中的“拼写错误”字进行检查触发的另一个示例:

该单词已完成,语法高亮显示在单词开头仍有一个错误。
对于我以前使用的旧版本的IntelliJ,情况并非如此。
我尝试过“使缓存失效/重新启动”,这将消除语法高亮显示中的当前错误,但不会阻止新错误的出现。
这里有什么问题吗?如何强制IntelliJ自动重新评估其语法高亮显示?我怎么才能解决这个问题?
更新
基于idea.log日志的注释中的请求
2020-10-19 12:39:15,589 [12546211] ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 2020.2.3 Build #IU-202.7660.26
2020-10-19 12:39:15,589 [12546211] ERROR - aemon.impl.PassExecutorService - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2020-10-19 12:39:15,590 [12546212] ERROR - aemon.impl.PassExecutorService - OS: Windows 10
2020-10-19 12:39:15,591 [12546213] ERROR - aemon.impl.PassExecutorService - Last Action: EditorUp
2020-10-19 12:39:15,591 [12546213] ERROR - aemon.impl.PassExecutorService - Invalid range specified: (5, 1);
java.lang.IllegalArgumentException: Invalid range specified: (5, 1);
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:221)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:216)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:212)
at com.intellij.openapi.util.TextRange.<init>(TextRange.java:40)
at com.intellij.openapi.util.TextRange.<init>(TextRange.java:29)
at com.intellij.psi.util.PartiallyKnownString$mapRangeToHostRange$1.invoke(PartiallyKnownString.kt:189)
at com.intellij.psi.util.PartiallyKnownString.mapRangeToHostRange(PartiallyKnownString.kt:213)
at com.intellij.psi.util.PartiallyKnownString$split$2$2.invoke(PartiallyKnownString.kt:130)
at com.intellij.psi.util.PartiallyKnownString$split$2.invoke(PartiallyKnownString.kt:156)
at com.intellij.psi.util.PartiallyKnownString.split(PartiallyKnownString.kt:166)
at com.intellij.microservices.url.references.UrlPksParser.splitUrlPath(UrlPksParser.kt:129)
at com.intellij.microservices.url.references.UrlPksParser.parseFullUrl(UrlPksParser.kt:62)
at com.intellij.microservices.url.references.UrlPathReferenceInjector.buildFullUrlReference(UrlPathReferenceInjector.kt:67)
at com.intellij.javascript.microservices.JSUrlPathReferenceProvider.getReferencesByElement(JSUrlPathReferenceProvider.kt:17)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:202)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:165)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:145)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:40)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:153)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:76)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:120)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:39)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:32)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:103)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$static$0(JSLiteralExpressionImpl.java:78)
at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:46)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCachedValue.java:35)
at com.intellij.psi.util.CachedValuesManager.getParameterizedCachedValue(CachedValuesManager.java:81)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.getReferences(JSLiteralExpressionImpl.java:88)
at com.jetbrains.nodejs.codeInsight.NodeCoreCodingAssistanceInspection.handleFileReferenceHolder(NodeCoreCodingAssistanceInspection.java:50)
at com.jetbrains.nodejs.codeInsight.NodeCoreCodingAssistanceInspection.access$000(NodeCoreCodingAssistanceInspection.java:24)
at com.jetbrains.nodejs.codeInsight.NodeCoreCodingAssistanceInspection$1.visitJSLiteralExpression(NodeCoreCodingAssistanceInspection.java:39)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.accept(JSLiteralExpressionImpl.java:128)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:56)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:296)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:265)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:155)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:147)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:264)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:264)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
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.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:183)
2020-10-19 12:39:15,592 [12546214] ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 2020.2.3 Build #IU-202.7660.26
2020-10-19 12:39:15,592 [12546214] ERROR - aemon.impl.PassExecutorService - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2020-10-19 12:39:15,592 [12546214] ERROR - aemon.impl.PassExecutorService - OS: Windows 10
2020-10-19 12:39:15,592 [12546214] ERROR - aemon.impl.PassExecutorService - Last Action: EditorUp
2020-10-19 12:39:19,268 [12549890] INFO - re.component.SaveActionManager - [+] Start SaveActionManager#beforeAllDocumentsSaving
2020-10-19 12:39:19,268 [12549890] INFO - re.component.SaveActionManager - Locating psi files for 0 documents: []
2020-10-19 12:39:19,268 [12549890] INFO - re.component.SaveActionManager - End SaveActionManager#beforeAllDocumentsSaving
2020-10-19 12:39:19,809 [12550431] INFO - rationStore.ComponentStoreImpl - Saving Project(name=parent, containerState=ACTIVE, componentStore=C:\Projects\xxxxxxx)RunManager took 15 ms
2020-10-19 12:39:22,061 [12552683] INFO - .clearcut.ClearcutLogScheduler - Flushing logs.
2020-10-19 12:39:22,061 [12552683] INFO - .clearcut.ClearcutLogScheduler - Scheduling next log flush in 60000 ms.
2020-10-19 12:40:00,335 [12590957] INFO - j.ide.actions.RevealFileAction - Exit code 1
2020-10-19 12:40:00,608 [12591230] INFO - re.component.SaveActionManager - [+] Start SaveActionManager#beforeAllDocumentsSaving
2020-10-19 12:40:00,608 [12591230] INFO - re.component.SaveActionManager - Locating psi files for 0 documents: []
2020-10-19 12:40:00,608 [12591230] INFO - re.component.SaveActionManager - End SaveActionManager#beforeAllDocumentsSaving
2020-10-19 12:40:01,085 [12591707] INFO - rationStore.ComponentStoreImpl - Saving Project(name=parent, containerState=ACTIVE, componentStore=C:\Projects\xxxxxxx)ArquillianContainersManager took 29 ms, RunManager took 12 ms 这让我相信SaveActionManager有问题.进一步调查。
更新2
但是,删除了SaveActionManager插件并重新启动它没有修复一些问题,这会导致一个更直接的错误,这个错误具体出现在我目前正在编辑并直接处理语法突出显示的文件中:
2020-10-19 12:50:45,329 [ 122921] INFO - ramework.JobViewEditorProvider - start JobViewEditorProvider
2020-10-19 12:50:49,237 [ 126829] ERROR - n.impl.GeneralHighlightingPass - In file: file://C:/Projects/xxxxxx/automation-test/cypress/integration/050-environments/140-xxxxxx.spec.js
java.lang.IllegalArgumentException: Invalid range specified: (5, 1);
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:221)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:216)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:212)
at com.intellij.openapi.util.TextRange.<init>(TextRange.java:40)
at com.intellij.openapi.util.TextRange.<init>(TextRange.java:29)
at com.intellij.psi.util.PartiallyKnownString$mapRangeToHostRange$1.invoke(PartiallyKnownString.kt:189)
at com.intellij.psi.util.PartiallyKnownString.mapRangeToHostRange(PartiallyKnownString.kt:213)
at com.intellij.psi.util.PartiallyKnownString$split$2$2.invoke(PartiallyKnownString.kt:130)
at com.intellij.psi.util.PartiallyKnownString$split$2.invoke(PartiallyKnownString.kt:156)
at com.intellij.psi.util.PartiallyKnownString.split(PartiallyKnownString.kt:166)
at com.intellij.microservices.url.references.UrlPksParser.splitUrlPath(UrlPksParser.kt:129)
at com.intellij.microservices.url.references.UrlPksParser.parseFullUrl(UrlPksParser.kt:62)
at com.intellij.microservices.url.references.UrlPathReferenceInjector.buildFullUrlReference(UrlPathReferenceInjector.kt:67)
at com.intellij.javascript.microservices.JSUrlPathReferenceProvider.getReferencesByElement(JSUrlPathReferenceProvider.kt:17)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:202)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:165)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:145)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:40)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:153)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:76)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:120)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:39)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:32)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:103)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$static$0(JSLiteralExpressionImpl.java:78)
at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:46)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCachedValue.java:35)
at com.intellij.psi.util.CachedValuesManager.getParameterizedCachedValue(CachedValuesManager.java:81)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.getReferences(JSLiteralExpressionImpl.java:88)
at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.annotate(HyperlinkAnnotator.java:44)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:136)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:116)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:338)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:277)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:300)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:598)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:300)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:300)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:96)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:300)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:268)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:214)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:80)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:54)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:399)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:392)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:391)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:367)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:365)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181)
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:183)
2020-10-19 12:50:49,242 [ 126834] ERROR - n.impl.GeneralHighlightingPass - IntelliJ IDEA 2020.2.3 Build #IU-202.7660.26
2020-10-19 12:50:49,242 [ 126834] ERROR - n.impl.GeneralHighlightingPass - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2020-10-19 12:50:49,243 [ 126835] ERROR - n.impl.GeneralHighlightingPass - OS: Windows 10
2020-10-19 12:50:49,252 [ 126844] ERROR - n.impl.GeneralHighlightingPass - Last Action: EditorEnter
2020-10-19 12:50:51,908 [ 129500] INFO - dea.updater.SdkComponentSource - File C:\Users\xxxxx\.android\repositories.cfg could not be loaded. 更新3
根据评论中的建议,打开bug票证:https://youtrack.jetbrains.com/issue/IDEA-253270
https://stackoverflow.com/questions/64424019
复制相似问题