tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
485 stars 38 forks source link

java.util.EmptyStackException when there are html and svelte tags opened in one moment #152

Closed leamm closed 3 years ago

leamm commented 4 years ago

Getting next error in a svelte component file

java.util.EmptyStackException
    at com.intellij.util.containers.Stack.pop(Stack.java:46)
    at dev.blachut.svelte.lang.parsing.html.ExtendableHtmlParsing.closeTag(ExtendableHtmlParsing.java:326)
    at dev.blachut.svelte.lang.parsing.html.SvelteHtmlParsing.flushOpenTags(SvelteHtmlParsing.kt:85)
    at dev.blachut.svelte.lang.parsing.html.ExtendableHtmlParsing.parseDocument(ExtendableHtmlParsing.java:97)
    at com.intellij.lang.html.HTMLParser.parseWithoutBuildingTree(HTMLParser.java:32)
    at com.intellij.lang.html.HTMLParser.parse(HTMLParser.java:20)
    at com.intellij.psi.tree.ILazyParseableElementType.doParseContents(ILazyParseableElementType.java:81)
    at com.intellij.psi.tree.IFileElementType.parseContents(IFileElementType.java:53)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:192)
    at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:565)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:191)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:242)
    at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:126)
    at com.intellij.psi.impl.BlockSupportImpl.findReparseableRoots(BlockSupportImpl.java:116)
    at com.intellij.psi.impl.BlockSupportImpl.reparse(BlockSupportImpl.java:86)
    at com.intellij.psi.impl.DocumentCommitThread.doCommit(DocumentCommitThread.java:294)
    at com.intellij.psi.impl.DocumentCommitThread.commitUnderProgress(DocumentCommitThread.java:135)
    at com.intellij.psi.impl.DocumentCommitThread.lambda$commitAsynchronously$0(DocumentCommitThread.java:84)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:498)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$2(NonBlockingReadActionImpl.java:446)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:77)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:153)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:114)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:56)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
    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.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:56)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:111)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:77)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:463)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$0(NonBlockingReadActionImpl.java:387)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:215)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:26)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:194)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:207)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:183)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:834)

To reproduce: if html tag is open and svelte tag also is open, trying to type </ causing this error

<div>
{#if 1 }
  abc
  </
tomblachut commented 3 years ago

Will be fixed in next release.