kinglozzer / idea-silverstripe-plugin Goto Github PK
View Code? Open in Web Editor NEWA plugin to add Silverstripe template support to PHPStorm and other JetBrains IDEs.
License: MIT License
A plugin to add Silverstripe template support to PHPStorm and other JetBrains IDEs.
License: MIT License
TIL it’s possible to call pretty much any Requirements
method, not just css
/javascript
. E.g:
<% require insertHeadTags('<link href="//i.vimeocdn.com" rel="dns-prefetch" />') %>
This always seems to stem from code folding, which probably indicates we’re doing something “non-dumb” despite implementing the DumbAware
interface.
Simplest fix might be to check if the IDE is currently in dumb mode with DumbService.isDumb()
and just avoid attempting folding if it is, or just remove DumbAware
entirely.
Example stacktrace:
java.util.NoSuchElementException
at java.base/java.util.ArrayDeque.removeFirst(ArrayDeque.java:363)
at java.base/java.util.ArrayDeque.pop(ArrayDeque.java:594)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseStatement(SilverstripeParser.java:156)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseStatements(SilverstripeParser.java:63)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseRoot(SilverstripeParser.java:46)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parse(SilverstripeParser.java:29)
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:567)
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.source.tree.SharedImplUtil.getFirstChild(SharedImplUtil.java:37)
at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:744)
at com.kinglozzer.silverstripe.ide.folding.SilverstripeFoldingBuilder.appendDescriptors(SilverstripeFoldingBuilder.java:82)
at com.kinglozzer.silverstripe.ide.folding.SilverstripeFoldingBuilder.buildFoldRegions(SilverstripeFoldingBuilder.java:29)
at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptorsNoPlaceholderCaching(LanguageFolding.java:99)
at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptors(LanguageFolding.java:75)
at com.intellij.codeInsight.folding.impl.FoldingUpdate.getFoldingsFor(FoldingUpdate.java:267)
at com.intellij.codeInsight.folding.impl.FoldingUpdate.getFoldingsFor(FoldingUpdate.java:233)
at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.buildInitialFoldings(CodeFoldingManagerImpl.java:134)
at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.loadEditorInBackground(PsiAwareTextEditorImpl.java:48)
at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.lambda$scheduleLoading$0(AsyncEditorLoader.java:96)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.lambda$scheduleLoading$1(AsyncEditorLoader.java:94)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:521)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:468)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:76)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:152)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:113)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:59)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:110)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:76)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:486)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:408)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:216)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:27)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:195)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:184)
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)
Hi there,
I noticed today that this plugin appears to be causing inconsistent results for "Find in Files"
By inconsistent results I mean different numbers of results each time I rerun the search - I'd get 25 one time, then 30, then 47, then back to 25...
I initially assumed this was a PhpStorm issue so did some searching around and saw a suggestion plugins could impact "Find in Files" results - so given this is the only non-bundled plugin I have installed in PhpStorm it was the first I tried and the problem went away
I'm running PhpStorm 2021.2.2 (build 212.5284.49) on Ubuntu 20.04 and saw this issue with versions 1.0.2 and 1.0.3 of this plugin enabled.
Let me know if I can provide any more info - I'm not too sure on how to debug idea plugins
The live templates from the original plugin look like they should work: https://github.com/raket/idea-silverstripe/tree/master/resources/liveTemplates.
In my initial testing they didn’t backtrack far enough during replacement:
<!-- Selecting the completion after this -->
<% if
<!-- Would result in something like this -->
<%<% if
It could be because the templates have to use HTML entities for <
and %
characters, and the IDE doesn’t take that into account - in which case it would be a platform bug. Needs more investigation anyway.
Would it be possible to highlight the corresponding close tags, as it is already the case for normal html elements?
I thought that this worked in the past.
OK, granted this is a minor one!
The Silverstripe icon in the files list is currently showing up in black on my system. It's probably OK if you're on a light theme, but on mine (which is a dark theme) it's a bit nasty.
Just wondering if the S should be blue.. not sure what the brand guidelines say about it.
This one is new to me:
java.lang.RuntimeException: Unbalanced tree. Most probably caused by unbalanced markers. Try calling setDebugMode(true) against PsiBuilder passed to identify exact location of the problem
at com.intellij.lang.impl.PsiBuilderImpl.createComposite(PsiBuilderImpl.java:1294)
at com.intellij.lang.impl.PsiBuilderImpl.bind(PsiBuilderImpl.java:1214)
at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:906)
at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:892)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parse(SilverstripeParser.java:42)
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:567)
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.source.tree.SharedImplUtil.getFirstChild(SharedImplUtil.java:37)
at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:740)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:123)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:73)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideAllRoots(Divider.java:60)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:165)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
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:183)
Just popped up when I opened an existing project (that's been opened / indexed already)
e.g. highlight some text, use surround shortcut, it could then produce:
<%t <cursor> 'Highlighted text' %>
Not sure if this is something project-specific, but it's happened a couple of times:
java.lang.ClassCastException: class com.intellij.psi.impl.source.PsiPlainTextFileImpl cannot be cast to class com.kinglozzer.silverstripe.psi.SilverstripePsiFile (com.intellij.psi.impl.source.PsiPlainTextFileImpl is in unnamed module of loader com.intellij.util.lang.PathClassLoader @769c9116; com.kinglozzer.silverstripe.psi.SilverstripePsiFile is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5f4ab104) at com.kinglozzer.silverstripe.util.SilverstripeFileUtil.findValidTemplates(SilverstripeFileUtil.java:65) at com.kinglozzer.silverstripe.util.SilverstripeFileUtil.findIncludeTemplate(SilverstripeFileUtil.java:27) at com.kinglozzer.silverstripe.inspections.SilverstripeIncludeAnnotator.annotate(SilverstripeIncludeAnnotator.java:31) at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:131) at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:108) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:347) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$7(GeneralHighlightingPass.java:279) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:306) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$8(GeneralHighlightingPass.java:309) at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:606) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:309) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$8(GeneralHighlightingPass.java:309) at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:93) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:309) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:276) at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:221) at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:97) at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1154) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368) at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174) at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:215) at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366) at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:184) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
I'll see if I can identify any pattern, but I thought I should log the debug info whilst I have it!
Updated PHPStorm to 2021.1 this morning. Just opened up an older Silverstripe 3 project and got the following.
A Silverstripe 4 project opens just fine, so presumably it's something to do with a specific syntax / layout / feature in the older code. It consistently errors when opening the project. (Was OK in PS 2020.x)
PHPStorm: 2021.1
Plugin: 0.3.0
OS: Linux Mint 20.1
java.lang.Throwable: Another not done marker added after this one. Must be done before this.
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.lang.impl.MarkerProduction.doHeavyChecksOnMarkerDone(MarkerProduction.java:179)
at com.intellij.lang.impl.PsiBuilderImpl.doValidityChecks(PsiBuilderImpl.java:873)
at com.intellij.lang.impl.PsiBuilderImpl.processDone(PsiBuilderImpl.java:845)
at com.intellij.lang.impl.PsiBuilderImpl.access$900(PsiBuilderImpl.java:50)
at com.intellij.lang.impl.PsiBuilderImpl$StartMarker.done(PsiBuilderImpl.java:356)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseNestedStatements(SilverstripeParser.java:246)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseStatementsMaybeNestedInClosedBlock(SilverstripeParser.java:294)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseStatement(SilverstripeParser.java:106)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseStatements(SilverstripeParser.java:64)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseRoot(SilverstripeParser.java:47)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parse(SilverstripeParser.java:30)
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:567)
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.source.tree.SharedImplUtil.getFirstChild(SharedImplUtil.java:37)
at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:740)
at com.kinglozzer.silverstripe.ide.folding.SilverstripeFoldingBuilder.appendDescriptors(SilverstripeFoldingBuilder.java:82)
at com.kinglozzer.silverstripe.ide.folding.SilverstripeFoldingBuilder.buildFoldRegions(SilverstripeFoldingBuilder.java:29)
at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptorsNoPlaceholderCaching(LanguageFolding.java:99)
at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptors(LanguageFolding.java:75)
at com.intellij.codeInsight.folding.impl.FoldingUpdate.getFoldingsFor(FoldingUpdate.java:267)
at com.intellij.codeInsight.folding.impl.FoldingUpdate.getFoldingsFor(FoldingUpdate.java:233)
at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.buildInitialFoldings(CodeFoldingManagerImpl.java:135)
at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.loadEditorInBackground(PsiAwareTextEditorImpl.java:48)
at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.lambda$scheduleLoading$0(AsyncEditorLoader.java:97)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.lambda$scheduleLoading$1(AsyncEditorLoader.java:95)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:521)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:468)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:79)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:157)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:119)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:57)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:57)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:116)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:79)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:486)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:408)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:216)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:27)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:195)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:184)
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)
Plugin version: 0.0.2
PhpStorm Version: 2020.3.2 Build #PS-203.7148.74
$
Causes the editor to hang for a while, sometimes indefinitely, sometimes runs out of memory.
com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$InvalidStateException: com.kinglozzer.silverstripe.ide.highlighting.SilverstripeTemplateHighlighter(com.kinglozzer.silverstripe.parser.SilverstripeLexer): Error updating after DocumentEventImpl[myOffset=0, myOldLength=0, myNewLength=1].
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.documentChanged(LexerEditorHighlighter.java:342)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter.documentChanged(LayeredLexerEditorHighlighter.java:173)
at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:915)
at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:819)
at com.intellij.openapi.editor.impl.DocumentImpl.insertString(DocumentImpl.java:551)
at com.intellij.openapi.editor.EditorModificationUtil.insertStringAtCaretNoScrolling(EditorModificationUtil.java:104)
at com.intellij.openapi.editor.EditorModificationUtil.insertStringAtCaret(EditorModificationUtil.java:80)
at com.intellij.openapi.editor.EditorModificationUtil.insertStringAtCaret(EditorModificationUtil.java:72)
at com.intellij.codeInsight.editorActions.TypedHandler.type(TypedHandler.java:245)
at com.intellij.codeInsight.editorActions.TypedHandler.lambda$execute$4(TypedHandler.java:197)
at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$3(CaretModelImpl.java:312)
at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:421)
at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:321)
at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:296)
at com.intellij.codeInsight.editorActions.TypedHandler.execute(TypedHandler.java:154)
at com.intellij.codeInsight.lookup.impl.LookupTypedHandler.execute(LookupTypedHandler.java:75)
at com.intellij.codeInsight.template.emmet.EmmetPreviewTypedHandler.execute(EmmetPreviewTypedHandler.java:39)
at com.intellij.openapi.editor.impl.DefaultRawTypedHandler$1.run(DefaultRawTypedHandler.java:55)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1000)
at com.intellij.openapi.editor.impl.DefaultRawTypedHandler.execute(DefaultRawTypedHandler.java:49)
at com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler.execute(EditorFactoryImpl.java:275)
at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$2(TypedAction.java:183)
at com.intellij.reporting.FreezeLoggerImpl.runUnderPerformanceMonitor(FreezeLoggerImpl.java:28)
at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:183)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedNormally(EditorImpl.java:1320)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1302)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3410)
at com.intellij.openapi.editor.impl.EditorImpl$8.keyTyped(EditorImpl.java:1143)
at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247)
at java.desktop/java.awt.Component.processKeyEvent(Component.java:6607)
at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2852)
at java.desktop/java.awt.Component.processEvent(Component.java:6429)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1961)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:878)
at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1148)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1017)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:843)
at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.java:41)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4908)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:896)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:837)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: com.intellij.diagnostic.PluginException: Lexer is not progressing after calling advance(): com.kinglozzer.silverstripe.parser.SilverstripeLexer [Plugin: com.kinglozzer.silverstripe]
at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:337)
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:59)
at com.intellij.openapi.editor.ex.util.ValidatingLexerWrapper.throwException(ValidatingLexerWrapper.java:126)
at com.intellij.openapi.editor.ex.util.ValidatingLexerWrapper.advance(ValidatingLexerWrapper.java:97)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.doSetText(LexerEditorHighlighter.java:453)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.setText(LexerEditorHighlighter.java:420)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter.setText(LayeredLexerEditorHighlighter.java:124)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.incrementalUpdate(LexerEditorHighlighter.java:173)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.documentChanged(LexerEditorHighlighter.java:334)
... 70 more
com.intellij.diagnostic.PluginException: Lexer is not progressing after calling advance(): com.kinglozzer.silverstripe.parser.SilverstripeLexer [Plugin: com.kinglozzer.silverstripe]
at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:337)
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:59)
at com.intellij.openapi.editor.ex.util.ValidatingLexerWrapper.throwException(ValidatingLexerWrapper.java:126)
at com.intellij.openapi.editor.ex.util.ValidatingLexerWrapper.advance(ValidatingLexerWrapper.java:97)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.doSetText(LexerEditorHighlighter.java:453)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(LexerEditorHighlighter.java:139)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter.createBaseIterator(LayeredLexerEditorHighlighter.java:189)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter$LayeredHighlighterIteratorImpl.<init>(LayeredLexerEditorHighlighter.java:555)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter.createIterator(LayeredLexerEditorHighlighter.java:183)
at com.intellij.openapi.editor.impl.view.IterationState.<init>(IterationState.java:131)
at com.intellij.openapi.editor.impl.view.EditorPainter$Session.paintLineFragments(EditorPainter.java:1423)
at com.intellij.openapi.editor.impl.view.EditorPainter$Session.paintBackground(EditorPainter.java:352)
at com.intellij.openapi.editor.impl.view.EditorPainter$Session.paint(EditorPainter.java:180)
at com.intellij.openapi.editor.impl.view.EditorPainter.paint(EditorPainter.java:69)
at com.intellij.openapi.editor.impl.view.EditorView.paint(EditorView.java:269)
at com.intellij.openapi.editor.impl.EditorImpl.paint(EditorImpl.java:1948)
at com.intellij.openapi.editor.impl.EditorComponentImpl.paintComponent(EditorComponentImpl.java:250)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1077)
at com.intellij.openapi.editor.impl.EditorComponentImpl.paint(EditorComponentImpl.java:124)
at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5263)
at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:246)
at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1333)
at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5211)
at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5021)
at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:868)
at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:851)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:851)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:826)
at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:775)
at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1901)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:497)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
This happens very sporadically, and only ever happens during background indexing. Line referenced is:
Silverstripe allows registering additional block statements, e.g. the cacheinclude module provides statements like:
<% cache_include 'App/Includes/SomeInclude', 'IncludeCacheName' %>
<% cache 'CacheName' %>
<ul>
<% loop $SomeExpensiveLookup %>
<li>{$Title}</li>
<% end_loop %>
</ul>
<% end_cache %>
The plugin should support these statements, based on whatever the PEG parser allows
This only seems to occur when the Vue plugin is enabled and the project in question has Vue components to “activate” the plugin (using PsiViewer, the file is parsed in both Silverstripe and Vue languages).
This template appears to trigger it consistently:
<div class="element">
<div class="typography">
<h2>Something</h2>
</div>
</div>
Backspace won’t clear the whitespace before the opening <h2>
tag, but the delete key will.
Things to investigate:
.ss
files, but not .html
filesPsiWhiteSpace
elements instead of one big SS_TEXT
lump will solve this.ss
files - this probably isn’t desirableProbably a regression from ba278f8
Happened to stumble upon this stack trace when editing an *.ss
template in PhpStorm 2021.3 (PS-213.5744.279). right now seems like a one-off but figured I'd submit in case you could find/narrow down or reproduce:
java.lang.IndexOutOfBoundsException: Wrong offset: -1. Should be in range: [0, 604]
at com.intellij.openapi.editor.ex.util.SegmentArray.offsetOutOfRange(SegmentArray.java:89)
at com.intellij.openapi.editor.ex.util.SegmentArray.findSegmentIndex(SegmentArray.java:103)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.<init>(LexerEditorHighlighter.java:613)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(LexerEditorHighlighter.java:143)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter$Mapper.createIterator(LayeredLexerEditorHighlighter.java:427)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter$LayeredHighlighterIteratorImpl.initLayer(LayeredLexerEditorHighlighter.java:572)
at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter$LayeredHighlighterIteratorImpl.retreat(LayeredLexerEditorHighlighter.java:648)
at com.kinglozzer.silverstripe.ide.braces.SilverstripeBraceMatcher.isLBraceToken(SilverstripeBraceMatcher.java:94)
at com.intellij.codeInsight.highlighting.BraceMatchingUtil.isLBraceToken(BraceMatchingUtil.java:308)
at com.intellij.codeInsight.highlighting.BraceMatchingUtil.computeHighlightingAndNavigationContext(BraceMatchingUtil.java:90)
at com.intellij.codeInsight.highlighting.BraceMatchingUtil.computeHighlightingAndNavigationContext(BraceMatchingUtil.java:61)
at com.intellij.codeInsight.highlighting.BraceHighlightingHandler.updateBraces(BraceHighlightingHandler.java:137)
at com.intellij.codeInsight.highlighting.BackgroundHighlighter.lambda$updateHighlighted$2(BackgroundHighlighter.java:155)
at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.lambda$lookForInjectedFileInOtherThread$2(BackgroundHighlightingUtil.java:68)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$6(NonBlockingReadActionImpl.java:577)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Thanks so much for this plugin! It's great that the idea-plugin is getting an update!
I have found some inconsistencies with the template include highlighting, that might need some attention. I think it's valid to have numbers as part of a template name, isn't it? The previous idea-plugin had issues with this naming as well. It shows the include as being erroneous. See:
Also there are inconsistencies with the coloring when using namespaced template names and "regular" includes:
Regular include:
Namespaced:
This is not a major issue, but it would be visually helpful that the namespaced template names don't look like comments :-D
The plugin is marking some blocks for me as incomplete, even though they are.
See attached Layout file (with added .txt extension so Github will let me upload it), and screenshot showing highlighting.
Likely a regression from deee7f3
The following template parses $Me
as a lookup, but the following <
is parsed as SS_TEXT
separately to the rest of the
% end_loop %>
statement
<% if $ElementControllers %>
<% loop $ElementControllers %>
$Me
<% end_loop %>
<% end_if %>
I think the first error occured when I tried to watch a diff in a git commit.
java.lang.Throwable: Another not done marker added after this one. Must be done before this.
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.lang.impl.MarkerProduction.doHeavyChecksOnMarkerDone(MarkerProduction.java:179)
at com.intellij.lang.impl.PsiBuilderImpl.doValidityChecks(PsiBuilderImpl.java:873)
at com.intellij.lang.impl.PsiBuilderImpl.processDone(PsiBuilderImpl.java:845)
at com.intellij.lang.impl.PsiBuilderImpl.access$900(PsiBuilderImpl.java:50)
at com.intellij.lang.impl.PsiBuilderImpl$StartMarker.done(PsiBuilderImpl.java:356)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseStatements(SilverstripeParser.java:73)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parseRoot(SilverstripeParser.java:46)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parse(SilverstripeParser.java:29)
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:567)
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.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:33)
at com.intellij.psi.AbstractFileViewProvider.findElementAt(AbstractFileViewProvider.java:246)
at com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider.findElementAt(MultiplePsiFilesPerDocumentFileViewProvider.java:162)
at com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider.findElementAt(MultiplePsiFilesPerDocumentFileViewProvider.java:174)
at com.intellij.completion.ml.common.RecentPlacesFeatures$StoreRecentPlacesListener$recentPlaceAdded$1.run(RecentPlacesFeatures.kt:72)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:521)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:468)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:79)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:157)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:119)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:57)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:57)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:116)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:79)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:486)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:408)
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)
and
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: Silverstripe,
context: '
<div class="container container--flex-1-1">
<div>
<% include ElementTitle %>
$Title
<% if $HTML %>
$HTML
<% else %>
$Agency.Content
<% end_if %>
</div>
<div class="container--flex-1-1">
<div>
<h3>Facts</h3>
<% with $Agency %>
<p>
$Title <br>
<% if $Country %>
Location: $Country <br>
<% end_if %>
<% if $Founded %>
Founded: $Founded<br>
<% end_if %>
</p>
<p>
<% if $HomePage %>
$HomePage<br>
<% end_if %>
<%'
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.lang.impl.PsiBuilderImpl.reportUnbalancedMarkers(PsiBuilderImpl.java:1080)
at com.intellij.lang.impl.PsiBuilderImpl.assertMarkersBalanced(PsiBuilderImpl.java:1072)
at com.intellij.lang.impl.PsiBuilderImpl.balanceWhiteSpaces(PsiBuilderImpl.java:1094)
at com.intellij.lang.impl.PsiBuilderImpl.prepareLightTree(PsiBuilderImpl.java:1003)
at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:897)
at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:892)
at com.kinglozzer.silverstripe.parser.SilverstripeParser.parse(SilverstripeParser.java:42)
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:567)
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.source.tree.SharedImplUtil.getFirstChild(SharedImplUtil.java:37)
at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:740)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:123)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:73)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:77)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
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:183)
Given a theme structure:
templates/
Includes/
MyInclude.ss
Logos/
MyLogo.ss
Page.ss
Where Page.ss
contains:
<%-- This include does not link to the template file --%>
<% include MyInclude %>
<%-- Using the full namespace works as expected --%>
<% include Includes\MyInclude %>
<% include Logos\MyLogo %>
The first include tag doesn't link to the referenced template
Couldn't find include "MyInclude.ss"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.