Error ... refused to parse text with Language: TEXT; base: Language: Gosu; copy: Language: ...

My language plugin produces the following error when user types in editor. Any ideas at to what is causing this???

Scott

[  98013]  ERROR - l.source.text.BlockSupportImpl - View provider com.intellij.psi.SingleRootFileViewProvider@18b939f refused to parse text with Language: TEXT; base: Language: Gosu; copy: Language: Gosu; fileType: gw.internal.plugin.ij.GosuClassFileType@c88c68
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.psi.impl.source.text.BlockSupportImpl.a(BlockSupportImpl.java:196)
at com.intellij.psi.impl.source.text.BlockSupportImpl.a(BlockSupportImpl.java:146)
at com.intellij.psi.impl.source.text.BlockSupportImpl.access$000(BlockSupportImpl.java:52)
at com.intellij.psi.impl.source.text.BlockSupportImpl$2.run(BlockSupportImpl.java:96)
at com.intellij.psi.impl.PsiManagerImpl$3.compute(PsiManagerImpl.java:209)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:118)
at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:207)
at com.intellij.psi.impl.source.text.BlockSupportImpl.reparseRange(BlockSupportImpl.java:94)
at com.intellij.psi.impl.PsiDocumentManagerImpl.commit(PsiDocumentManagerImpl.java:450)
at com.intellij.psi.impl.PsiDocumentManagerImpl$1.run(PsiDocumentManagerImpl.java:245)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:754)
at com.intellij.psi.impl.PsiDocumentManagerImpl.a(PsiDocumentManagerImpl.java:232)
at com.intellij.psi.impl.PsiDocumentManagerImpl.commitDocument(PsiDocumentManagerImpl.java:226)
at com.intellij.psi.impl.PsiDocumentManagerImpl.commitAllDocuments(PsiDocumentManagerImpl.java:195)
at com.intellij.codeInsight.daemon.impl.TextEditorBackgroundHighlighter.getPasses(TextEditorBackgroundHighlighter.java:84)
at com.intellij.codeInsight.daemon.impl.TextEditorBackgroundHighlighter.createPassesForEditor(TextEditorBackgroundHighlighter.java:127)
at com.intellij.codeInsight.daemon.impl.TextEditorBackgroundHighlighter.createPassesForEditor(TextEditorBackgroundHighlighter.java:35)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$2.run(DaemonCodeAnalyzerImpl.java:591)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:226)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:319)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:610)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:500)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[  98014]  ERROR - l.source.text.BlockSupportImpl - IntelliJ IDEA 9.0.3  Build #IU-95.429
[  98014]  ERROR - l.source.text.BlockSupportImpl - JDK: 1.6.0_21
[  98014]  ERROR - l.source.text.BlockSupportImpl - VM: Dynamic Code Evolution Client VM
[  98014]  ERROR - l.source.text.BlockSupportImpl - Vendor: Sun Microsystems Inc.
[  98014]  ERROR - l.source.text.BlockSupportImpl - OS: Windows 7
[  98014]  ERROR - l.source.text.BlockSupportImpl - Last Action: EditorBackSpace

1 comment
Comment actions Permalink

To follow up, I fixed the problem by implementing ParserDefinition for my language.  After debugging the API a bit it appears that if a custom language does not implement ParserDefinition, IJ assigns a plain text parser, which reports that the associated file type is also plain text and not the file type assigned to the file's extension via the plugin.  This mismatch of file types is the primary cause of the error.

I can understand the assumption that a custom language should implement ParserDefinition, I'll eventually fully implement it, but for plugins that are providing minimal support (in my case lexing and debugging) it would be better if the OpenApi would not require it i.e., I think this is a bug the API.

Just my 2 cents.

Scott

0

Please sign in to leave a comment.