Hi, I've been getting this exception all the time with idea 8.1. It just happens like once a minute no matter what I'm doing. I'm just guessing at the fix, no idea about its correctness. But it stops the assertion error, at least.
Here's the full stack trace:
java.lang.AssertionError
at net.jay.plugins.php.lang.lexer.PHPFlexLexer.advance(PHPFlexLexer.java:2740)
at com.intellij.lexer.FlexAdapter.locateToken(FlexAdapter.java:101)
at com.intellij.lexer.FlexAdapter.getTokenType(FlexAdapter.java:66)
at com.intellij.lang.impl.PsiBuilderImpl.a(PsiBuilderImpl.java:104)
at com.intellij.lang.impl.PsiBuilderImpl.<init>(PsiBuilderImpl.java:204)
at com.intellij.lang.PsiBuilderFactoryImpl.createBuilder(PsiBuilderFactoryImpl.java:3)
at com.intellij.psi.tree.IChameleonElementType.parseContents(IChameleonElementType.java:56)
at com.intellij.psi.impl.source.tree.ChameleonElement.transform(ChameleonElement.java:4)
at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformNoLock(ChameleonTransforming.java:42)
at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformChildrenNoLock(ChameleonTransforming.java:0)
at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformChildren(ChameleonTransforming.java:38)
at com.intellij.psi.impl.source.parsing.ChameleonTransforming.transformChildren(ChameleonTransforming.java:40)
at com.intellij.psi.impl.source.tree.CompositeElement.countChildren(CompositeElement.java:177)
at com.intellij.psi.impl.source.tree.CompositeElement.getChildrenAsPsiElements(CompositeElement.java:82)
at com.intellij.psi.impl.source.PsiFileImpl.getChildren(PsiFileImpl.java:278)
at net.jay.plugins.php.lang.psi.PHPFile.getChildrenForCache(PHPFile.java:62)
at net.jay.plugins.php.lang.psi.PHPFile.getLightCopy(PHPFile.java:80)
at net.jay.plugins.php.cache.PhpFileInfoFactory.createFileInfo(PhpFileInfoFactory.java:64)
at net.jay.plugins.php.cache.PhpFileInfoFactory.createFileInfo(PhpFileInfoFactory.java:33)
at net.jay.plugins.php.cache.PhpModuleFilesCache.createFileInfo(PhpModuleFilesCache.java:322)
at net.jay.plugins.php.cache.PhpModuleFilesCache.regenerateFileInfo(PhpModuleFilesCache.java:287)
at net.jay.plugins.php.cache.PhpModuleFilesCache.processFile(PhpModuleFilesCache.java:501)
at com.intellij.ide.startup.FileSystemSynchronizer.updateFiles(FileSystemSynchronizer.java:191)
at com.intellij.ide.startup.FileSystemSynchronizer.execute(FileSystemSynchronizer.java:72)
at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.b(RefreshSessionImpl.java:43)
at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEvents(RefreshSessionImpl.java:18)
at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl$2$1$1.run(RefreshQueueImpl.java:3)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:171)
at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl$2$1.run(RefreshQueueImpl.java:1)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:16)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:35)
Here's the patch:
--- src/net/jay/plugins/php/lang/lexer/PHPFlexLexer.java (revision 221)
+++ src/net/jay/plugins/php/lang/lexer/PHPFlexLexer.java (working copy)
@@ -2737,6 +2737,14 @@
zzMarkedPos += 1;
return PHPTokenTypes.ESCAPE_SEQUENCE;
}
+ if (eatResult == HeredocManager.EXPR_SUBT_SEEN) {
+ zzMarkedPos += 1;
+ return PHPTokenTypes.EXPR_SUBST_BEGIN;
+ }
+ if (eatResult == HeredocManager.VARIABLE_SEEN) {
+ zzMarkedPos += 1;
+ return PHPTokenTypes.VARIABLE;
+ }
assert(eatResult > 0);
zzMarkedPos += eatResult - 1;
return PHPTokenTypes.HEREDOC_CONTENTS;