tomblachut / svelte-intellij

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

Plugin exception 0.13.0 in SvelteHtmlParsing #156

Closed Nrde closed 3 years ago

Nrde commented 4 years ago
java.lang.Throwable: Marker already done.
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:143)
    at com.intellij.lang.impl.PsiBuilderImpl.doValidityChecks(PsiBuilderImpl.java:879)
    at com.intellij.lang.impl.PsiBuilderImpl.processDone(PsiBuilderImpl.java:855)
    at com.intellij.lang.impl.PsiBuilderImpl.access$900(PsiBuilderImpl.java:46)
    at com.intellij.lang.impl.PsiBuilderImpl$StartMarker.done(PsiBuilderImpl.java:361)
    at dev.blachut.svelte.lang.parsing.html.OpenedBlock.handleEndTag(SvelteBlockParsing.kt:75)
    at dev.blachut.svelte.lang.parsing.html.SvelteHtmlParsing.parseSvelteTag(SvelteHtmlParsing.kt:41)
    at dev.blachut.svelte.lang.parsing.html.SvelteHtmlParsing.parseCustomTagContent(SvelteHtmlParsing.kt:66)
    at dev.blachut.svelte.lang.parsing.html.ExtendableHtmlParsing.parseTag(ExtendableHtmlParsing.java:302)
    at dev.blachut.svelte.lang.parsing.html.ExtendableHtmlParsing.parseDocument(ExtendableHtmlParsing.java:65)
    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.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:42)
    at com.intellij.psi.impl.BlockSupportImpl.isReplaceWholeNode(BlockSupportImpl.java:377)
    at com.intellij.psi.impl.BlockSupportImpl.mergeTrees(BlockSupportImpl.java:324)
    at com.intellij.psi.impl.BlockSupportImpl.makeFullParse(BlockSupportImpl.java:256)
    at com.intellij.psi.impl.BlockSupportImpl.reparse(BlockSupportImpl.java:88)
    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:508)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:456)
    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:473)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:397)
    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)
Nrde commented 4 years ago

Hard crash, can't type anything into editor after this, unless I cut the offending html snippet and then paste it between valid html tags. So the error occurs when changing a tag from div to span, and phpstorm replaces/tries to replace the opening and closing tag.

tomblachut commented 4 years ago

Hello, can you provide minimal example file with marked caret where error occurs? I'm not sure how to debug it without that

Nrde commented 4 years ago
<div class="foo">{data.bar}</div>

when selecting the opening "div" and cleared it to be replaced with "span" the exception occurred. so it stayed like this:

< class="foo">{data.bar}</>

I have had some other similarish freezes occasionally, but didn't pay attention to them that much.

airknights commented 4 years ago

This also crashes it. I wanted to replace this with a different html tag, and it crashed on the svelte file. <><School school={school} /></>

Seems to be issue when it tries to parse an empty tag like that, and the best way to duplicate it is type in any valid tag, and then erase it before wanting to type anything else, and that causes this. wanted to change from <li><School school={school} /></li> to <div><School school={school} /></div>

tomblachut commented 3 years ago

Fix will be included in next release