profile
viewpoint

Ask questionsUnbalanced tree error in AsciiDoc 0.30.32

I do get the following exception since my upgrade to 0.30.32 (probably a re-incarnation of #119):

Following exceptions happened soon after this one, most probably they are induced.


2020-01-27T11:54:44.539
java.lang.Throwable: Unbalanced tree. Most probably caused by unbalanced markers. Try calling setDebugMode(true) against PsiBuilder passed to identify exact location of the problem
language: Language: AsciiDoc, 
context: '<none>'
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145)
	at com.intellij.lang.impl.PsiBuilderImpl.reportUnbalancedMarkers(PsiBuilderImpl.java:1112)
	at com.intellij.lang.impl.PsiBuilderImpl.assertMarkersBalanced(PsiBuilderImpl.java:1104)
	at com.intellij.lang.impl.PsiBuilderImpl.prepareLightTree(PsiBuilderImpl.java:1073)
	at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:929)
	at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:924)
	at org.asciidoc.intellij.parser.AsciiDocParser.parse(AsciiDocParser.java:23)
	at com.intellij.psi.tree.ILazyParseableElementType.doParseContents(ILazyParseableElementType.java:75)
	at com.intellij.psi.tree.IFileElementType.parseContents(IFileElementType.java:53)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:198)
	at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:564)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:197)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:246)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:40)
	at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:190)
	at com.intellij.psi.impl.source.PsiFileImpl.acceptChildren(PsiFileImpl.java:733)
	at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:40)
	at com.intellij.psi.util.PsiFilter$Visitor.visitElement(PsiFilter.java:69)
	at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34)
	at com.intellij.psi.PsiRecursiveElementVisitor.visitFile(PsiRecursiveElementVisitor.java:59)
	at org.asciidoc.intellij.psi.AsciiDocFileUtil.findSections(AsciiDocFileUtil.java:50)
	at org.asciidoc.intellij.psi.AsciiDocChooseByNameContributor.getNames(AsciiDocChooseByNameContributor.java:15)
	at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel.processContributorNames(ContributorsBasedGotoByModel.java:127)
	at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel$1.processInReadAction(ContributorsBasedGotoByModel.java:86)
	at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel$1.processInReadAction(ContributorsBasedGotoByModel.java:80)
	at com.intellij.openapi.application.ReadActionProcessor.lambda$process$0(ReadActionProcessor.java:28)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.application.ReadActionProcessor.process(ReadActionProcessor.java:28)
	at com.intellij.concurrency.JobLauncherImpl.lambda$null$0(JobLauncherImpl.java:46)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
	at com.intellij.concurrency.JobLauncherImpl.lambda$invokeConcurrentlyUnderProgress$1(JobLauncherImpl.java:46)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:133)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:116)
	at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:99)
	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:177)


2020-01-27T11:54:45.488
java.lang.Throwable: Unbalanced tree. Most probably caused by unbalanced markers. Try calling setDebugMode(true) against PsiBuilder passed to identify exact location of the problem
language: Language: AsciiDoc, 
context: '<none>'
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145)
	at com.intellij.lang.impl.PsiBuilderImpl.reportUnbalancedMarkers(PsiBuilderImpl.java:1112)
	at com.intellij.lang.impl.PsiBuilderImpl.assertMarkersBalanced(PsiBuilderImpl.java:1104)
	at com.intellij.lang.impl.PsiBuilderImpl.prepareLightTree(PsiBuilderImpl.java:1073)
	at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:929)
	at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:924)
	at org.asciidoc.intellij.parser.AsciiDocParser.parse(AsciiDocParser.java:23)
	at com.intellij.psi.tree.ILazyParseableElementType.doParseContents(ILazyParseableElementType.java:75)
	at com.intellij.psi.tree.IFileElementType.parseContents(IFileElementType.java:53)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:198)
	at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:564)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:197)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:246)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:40)
	at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:190)
	at com.intellij.psi.impl.source.PsiFileImpl.acceptChildren(PsiFileImpl.java:733)
	at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:40)
	at com.intellij.psi.util.PsiFilter$Visitor.visitElement(PsiFilter.java:69)
	at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34)
	at com.intellij.psi.PsiRecursiveElementVisitor.visitFile(PsiRecursiveElementVisitor.java:59)
	at org.asciidoc.intellij.psi.AsciiDocFileUtil.findSections(AsciiDocFileUtil.java:50)
	at org.asciidoc.intellij.psi.AsciiDocChooseByNameContributor.getNames(AsciiDocChooseByNameContributor.java:15)
	at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel.processContributorNames(ContributorsBasedGotoByModel.java:127)
	at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel$1.processInReadAction(ContributorsBasedGotoByModel.java:86)
	at com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel$1.processInReadAction(ContributorsBasedGotoByModel.java:80)
	at com.intellij.openapi.application.ReadActionProcessor.lambda$process$0(ReadActionProcessor.java:28)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.application.ReadActionProcessor.process(ReadActionProcessor.java:28)
	at com.intellij.concurrency.JobLauncherImpl.lambda$null$0(JobLauncherImpl.java:46)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
	at com.intellij.concurrency.JobLauncherImpl.lambda$invokeConcurrentlyUnderProgress$1(JobLauncherImpl.java:46)
	at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:133)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
	at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:116)
	at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:99)
	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:177)
Please provide a minimal Asciidoctor example.
Sorry, no idea where this happens and how to reproduce it on a minimal example.
But willing to install custom builds and perform regressions ;-)

Thanks! -->

<!-- go to File -> Settings -> Plugins -> AsciiDoc and type in the version number you see --> AsciiDoc Plugin Version: 0.30.32

<!-- go to Help -> About, click on 'Copy to Clipboard' and paste the contents of your clipboard here --> IDE Name and Version: IntelliJ 2019.2.3 (Ultimate Edition)

asciidoctor/asciidoctor-intellij-plugin

Answer questions ahus1

I've looked at the code changes and didn't find a code example to reproduce it. I'd be happy if you could upgrade to the next pre-release 0.30.33 that allows extended debug and trace options:

After you installed the release, go to "Help | Debug Log Settings..." and enter (including the hash at the beginning):

#org.asciidoc.intellij.parser.AsciiDocParserImpl

This will log additional information once an unbalanced tree is been created. It will slow down the parser a bit, but will only log information when there is a problem.

To trace also the contents, change it to the following setting. This will log the contents on each parsing attempt. Beware: this will create a lot of logs!

#org.asciidoc.intellij.parser.AsciiDocParserImpl:trace

The logging settings can be changed at run time, no restart of the IDE is required.

The new pre-release of the plugin is available from GitHub releases and the IntelliJ AsciiDoc EAP repository.

useful!

Related questions

Add live template for config section hot 1
Integrate Computer Aid for writing Prose hot 1
Integrate Computer Aid for writing Prose hot 1
Browser preview for files outside current project / Asciidoc 0.28.22 hot 1
Generate a PDF "inside" the Asciidoctor IntelliJ plugin hot 1
Support for charts in Asciidoc plug-in. hot 1
Add support for environment variable GRAPHVIZ_DOT. hot 1
Asciidoc preview won't show up / Regression 0.25.9 hot 1
Are source highlighters other than coderay supported for live preview? hot 1
100% CPU hot 1
Edit Fragment for source blocks broken in 0.28.2 hot 1
Add plugin icon hot 1
Add quickfix to create include file if it doesn't exist already hot 1
Github User Rank List