ishchenko / idea-nginx

nginx server support plugin for IntelliJ IDEA
Do What The F*ck You Want To Public License
140 stars 39 forks source link

Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer #58

Closed artspb closed 7 years ago

artspb commented 7 years ago

We've received this exception from one of our users.

Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer

java.lang.IllegalStateException: Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer
    at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.doSetText(LexerEditorHighlighter.java:390)
    at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.setText(LexerEditorHighlighter.java:356)
    at com.intellij.openapi.editor.impl.EditorImpl.setHighlighter(EditorImpl.java:1144)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.updateHighlighters(TextEditorComponent.java:243)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.access$200(TextEditorComponent.java:63)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent$1.enteredDumbMode(TextEditorComponent.java:113)
    at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:434)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:395)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:384)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:377)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:368)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:232)
    at com.sun.proxy.$Proxy87.beforePsiChanged(Unknown Source)
    at com.intellij.psi.impl.PsiManagerImpl.beforeChange(PsiManagerImpl.java:461)
    at com.intellij.psi.impl.PsiManagerImpl.beforePropertyChange(PsiManagerImpl.java:273)
    at com.intellij.psi.impl.file.impl.FileManagerImpl$FileTypesChanged.run(FileManagerImpl.java:330)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:999)
    at com.intellij.psi.impl.file.impl.FileManagerImpl.handleFileTypesChange(FileManagerImpl.java:343)
    at com.intellij.psi.impl.file.impl.FileManagerImpl.updateAllViewProviders(FileManagerImpl.java:100)
    at com.intellij.psi.impl.file.impl.FileManagerImpl.access$400(FileManagerImpl.java:54)
    at com.intellij.psi.impl.file.impl.FileManagerImpl$4.enteredDumbMode(FileManagerImpl.java:300)
    at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:434)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:395)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:384)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:377)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:368)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:232)
    at com.sun.proxy.$Proxy54.modificationCountChanged(Unknown Source)
    at com.intellij.psi.impl.PsiModificationTrackerImpl.fireEvent(PsiModificationTrackerImpl.java:76)
    at com.intellij.psi.impl.PsiModificationTrackerImpl.incCounter(PsiModificationTrackerImpl.java:71)
    at com.intellij.psi.impl.PsiModificationTrackerImpl$1$1.run(PsiModificationTrackerImpl.java:50)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:999)
    at com.intellij.psi.impl.PsiModificationTrackerImpl$1.doIncCounter(PsiModificationTrackerImpl.java:47)
    at com.intellij.psi.impl.PsiModificationTrackerImpl$1.enteredDumbMode(PsiModificationTrackerImpl.java:57)
    at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:434)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:395)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:384)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:377)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:370)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:232)
    at com.sun.proxy.$Proxy65.enteredDumbMode(Unknown Source)
    at com.intellij.openapi.project.DumbServiceImpl.enterDumbMode(DumbServiceImpl.java:231)
    at com.intellij.openapi.project.DumbServiceImpl.lambda$queueTaskOnEdt$2(DumbServiceImpl.java:201)
    at com.intellij.openapi.application.WriteAction.run(WriteAction.java:94)
    at com.intellij.openapi.project.DumbServiceImpl.queueTaskOnEdt(DumbServiceImpl.java:201)
    at com.intellij.openapi.project.DumbServiceImpl.lambda$queueTask$1(DumbServiceImpl.java:187)
    at com.intellij.openapi.project.DumbServiceImpl.queueTask(DumbServiceImpl.java:189)
    at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.queueTasks(PushedFilePropertiesUpdaterImpl.java:186)
    at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.processAfterVfsChanges(PushedFilePropertiesUpdaterImpl.java:122)
    at com.intellij.psi.impl.file.impl.PsiVFSListener$1.after(PsiVFSListener.java:93)
    at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:434)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:395)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:384)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:368)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:232)
    at com.sun.proxy.$Proxy162.validityChanged(Unknown Source)
    at com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl.after(VirtualFilePointerManagerImpl.java:527)
    at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:434)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:395)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:384)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:368)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:232)
    at com.sun.proxy.$Proxy25.fileWithNoDocumentChanged(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.multiCast(FileDocumentManagerImpl.java:124)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$new$0(FileDocumentManagerImpl.java:103)
    at com.sun.proxy.$Proxy25.fileWithNoDocumentChanged(Unknown Source)
    at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.contentsChanged(FileDocumentManagerImpl.java:569)
    at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.EventDispatcher.dispatch(EventDispatcher.java:99)
    at com.intellij.util.EventDispatcher.access$200(EventDispatcher.java:35)
    at com.intellij.util.EventDispatcher$2.invoke(EventDispatcher.java:79)
    at com.sun.proxy.$Proxy22.contentsChanged(Unknown Source)
    at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.fireAfter(BulkVirtualFileListenerAdapter.java:65)
    at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.after(BulkVirtualFileListenerAdapter.java:56)
    at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
    at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:434)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:395)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:384)
    at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:370)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44)
    at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:232)
    at com.sun.proxy.$Proxy98.after(Unknown Source)
    at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.processEvents(PersistentFSImpl.java:775)
    at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEventsInWriteAction(RefreshSessionImpl.java:196)
    at com.intellij.openapi.application.WriteAction.run(WriteAction.java:94)
    at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEvents(RefreshSessionImpl.java:183)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:89)
    at com.intellij.openapi.application.TransactionGuardImpl.access$300(TransactionGuardImpl.java:39)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:114)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:124)
    at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl.lambda$null$0(RefreshQueueImpl.java:81)
    at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:315)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:408)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:397)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:818)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:655)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
CarsonF commented 7 years ago

I also ran into this on Intellij 2017.2 EAP (IU-172.2465.6).

Trace ``` java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.a(AsyncEditorLoader.java:136) at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.start(AsyncEditorLoader.java:80) at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.(TextEditorImpl.java:62) at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.(PsiAwareTextEditorImpl.java:44) at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.createEditor(PsiAwareTextEditorProvider.java:48) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.a(FileEditorManagerImpl.java:860) at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2700) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:959) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl3(FileEditorManagerImpl.java:787) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.a(FileEditorManagerImpl.java:769) at com.intellij.openapi.command.impl.CoreCommandProcessor.a(CoreCommandProcessor.java:149) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:109) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:769) at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:700) at com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.openFile(FileEditorManagerEx.java:155) at com.intellij.codeInsight.navigation.NavigationUtil.a(NavigationUtil.java:213) at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement(NavigationUtil.java:189) at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:239) at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:249) at com.intellij.ide.projectView.impl.nodes.PsiFileNode.navigate(PsiFileNode.java:133) at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:53) at com.intellij.util.OpenSourceUtil.openSourcesFrom(OpenSourceUtil.java:31) at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.processDoubleClick(EditSourceOnDoubleClickHandler.java:130) at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.onDoubleClick(EditSourceOnDoubleClickHandler.java:122) at com.intellij.ui.DoubleClickListener.onClick(DoubleClickListener.java:30) at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:73) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.Component.processMouseEvent(Component.java:6541) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:437) at com.intellij.ide.dnd.aware.DnDAwareTree.processMouseEvent(DnDAwareTree.java:58) at java.awt.Component.processEvent(Component.java:6306) at java.awt.Container.processEvent(Container.java:2237) at java.awt.Component.dispatchEventImpl(Component.java:4897) at java.awt.Container.dispatchEventImpl(Container.java:2295) at java.awt.Component.dispatchEvent(Component.java:4719) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467) at java.awt.Container.dispatchEventImpl(Container.java:2281) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4719) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:737) at java.awt.EventQueue$4.run(EventQueue.java:735) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:821) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:645) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:206) at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.a(AsyncEditorLoader.java:132) ... 67 more Caused by: java.lang.IllegalStateException: Unexpected termination offset for lexer FlexAdapter for net.ishchenko.idea.nginx.lexer._NginxLexer at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.a(LexerEditorHighlighter.java:388) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.setText(LexerEditorHighlighter.java:354) at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.loadEditorInBackground(TextEditorImpl.java:70) at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.loadEditorInBackground(PsiAwareTextEditorImpl.java:50) at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.a(AsyncEditorLoader.java:100) at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$commitAndRunReadAction$2(PsiDocumentManagerBase.java:502) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:954) at com.intellij.psi.impl.PsiDocumentManagerBase.commitAndRunReadAction(PsiDocumentManagerBase.java:500) at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.a(AsyncEditorLoader.java:98) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.a(ProgressIndicatorUtils.java:146) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:144) at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.a(AsyncEditorLoader.java:98) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) ```
Deadleg commented 7 years ago

Could you provide an example file that's causing the exception? Unfortunately the stack traces don't say anything more than "the lexer broke".

CarsonF commented 7 years ago

Hmm I had disabled the plugin, and I just reenabled it and everything is working fine :/ I know that's not helpful at all.

CarsonF commented 7 years ago

Just ran into this again. I don't think it's a problem with the actual lexer. Every nginx file throws this exception. For example:

# Prevent downgrade attacks (force HTTPS)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;" always;

It looks to be a concurrency problem instead.

Here's a similar issue with the yaml parser: https://youtrack.jetbrains.com/issue/DEXP-210188

Here's another one with a code fix: https://github.com/Camelcade/Perl5-IDEA/issues/901

abregar commented 7 years ago

I came across this issue myself (idea 2017.1.5 and 2017.2). Tried to debug a little with idea sdk plugin. It is reproducible with high accuracy if I do create multiple nginx.conf files and try to associate them with wild-card file types (eq.: nginx.conf).

It crashes in FlexAdapter.locateToken() with java.lang.ArrayIndexOutOfBoundsException: 0. zzBufer shows "" at this point. Interestingly - myFailed is set to true here and does not recover in any consequent conf file open. If I set myFailed=false within debugger, lexer starts to work until next crash :/ . Unfortunately I am not into JFlex enough to help further.

dancrumb commented 7 years ago

I'm hosting a copy of my config here: https://gist.github.com/dancrumb/f0ec9abe3111ee9b0e4f6255a5134393

I'm seeing this issue also.