mesour-intellij-plugins / latte-pro-issues

2 stars 0 forks source link

Text mismatch in Outer HTML/XML in Latte #154

Open inferius opened 5 months ago

inferius commented 5 months ago

Describe the bug Since you marked the last bug as resolved even after I reopened it, this seems to be a bug in a different place. So again, I am troubled by a crashing error.

The worst part is that the file doesn't even open; it just triggers an error in the IDE and nothing happens.

If I delete the content of the file outside of the editor, open it, and then insert the content back, it displays in the editor. Although it reports errors, the syntax highlighting doesn't work properly, but at least it can be edited.

It would be good if this add-on, since it is paid and not exactly cheap, had somewhat more flexible support and worked at least as well as the add-on that was free and whose development you have discontinued. This outright prevents work when the file doesn't even open. It would be nice if it at least opened without additional functions, but worked as well as the original add-on.

Environment (please complete the following information):

To Reproduce Steps to reproduce the behavior (or attach video):

  1. Open the file

In this specific case, I identified the problem on line 26 {getUpladedImageLatte($si["doctor_link.doctor_photo_list"]["value"]["id"], "{$si["doctor_link.name"]["value"]} - Photo", [ "width" => "400px", "class_name" => "mw"])} and it doesn’t help even when I modify the quotes to {getUpladedImageLatte($si["doctor_link.doctor_photo_list"]["value"]["id"], "{$si['doctor_link.name']['value']} - Photo", [ "width" => "400px", "class_name" => "mw"])} or completely remove them {getUpladedImageLatte($si["doctor_link.doctor_photo_list"]["value"]["id"], "{$si[doctor_link.name][value]} - Photo", [ "width" => "400px", "class_name" => "mw"])}. Simply, the part after {getUpladedImageLatte($si["doctor_link.doctor_photo_list"]["value"]["id"], "{$si breaks it.

Code

{\API\Frontend\PageTemplate::show("global/top/breadcrumbs", [
"items" => [
[ "url" => $object->getValue("url.url"), "active" => true, "text" => $breadcrumb_real ]
]
])}
{if !empty($object->getValue("content"))}
    <div class="full-container top-container-title">
        <div class="container">
            <div class="page-title left-title">
                <h1 class="h1">{replaceParamsInText(empty($object->getValue("page_title")) ? $object->getValue("name") : $object->getValue("page_title"))}</h1>
            </div>
        </div>
    </div>
    <div class="full-container mb-10">
        <div class="container cms-text-data">
            {replaceCode($object->getValue("content"))|noescape}
        </div>
    </div>

    {if !empty($doctors)}
    <div class="full-container doctor-info">
        <div class="container">
            <div class="items">
                <div class="content" n:foreach="$doctors as $si">
                    <div class="left">
                        {getUpladedImageLatte($si["doctor_link.doctor_photo_list"]["value"]["id"], "{$si["doctor_link.name"]["value"]} - Fotka", [ "width" => "400px", "class_name" => "mw"])}
                    </div>
                    <div class="right">
                        <div class="name">{$si["doctor_link.name"]["value"]}</div>
                        {if !empty($si["doctor_link.motto"]["value"])}<div class="motto">„{$si["doctor_link.motto"]["value"]}“</div>{/if}
                        <div class="role">{$si["doctor_link.specialization"]["value"]}</div>
                        <div class="flag-section">
                            {var $d_langs = explode(",", $si["doctor_link.supported_langs"]["value"])}
                            <img n:foreach="$d_langs as $dl" src="{$config['path']['relative']['uploaded']}{$languages[$dl]['icon']['value']['relative_path']}" alt="{$languages[$dl]['name']['value']}" loading="lazy">
                        </div>
                        <div class="text">
                            {if empty(trim(strip_tags($si["content"]["value"])))}
                                {$si["doctor_link.description"]["value"]|noescape}
                            {else}
                                {$si["content"]["value"]|noescape}
                            {/if}
                        </div>
                        <a href="/{$si['doctor_link.url.url']['value']}/" class="btn outline green under-text">{_read_more_btn_text}</a>
                    </div>
                </div>

            </div>

        </div>
    </div>
    {/if}

{/if}

{\API\Frontend\PageTemplate::show("global/full_contact_form")}

Exception

Text mismatch in Outer HTML/XML in Latte (com.mesour.intellij.latte.psi.aw)

com.intellij.diagnostic.PluginException: Text mismatch [Plugin: com.mesour.intellij.latte]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.assertTextLengthIntact(LazyParseableElement.java:206)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$2(LazyParseableElement.java:184)
    at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:535)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:182)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:234)
    at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:121)
    at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:33)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.findNextLeafElementAt(LowLevelSearchUtil.java:122)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processOffsets(LowLevelSearchUtil.java:196)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processElementsAtOffsets(LowLevelSearchUtil.java:177)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$6.execute(PsiSearchHelperImpl.java:1032)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.processInReadAction(PsiSearchHelperImpl.java:817)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.processInReadAction(PsiSearchHelperImpl.java:808)
    at com.intellij.openapi.application.ReadActionProcessor.lambda$process$0(ReadActionProcessor.java:11)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:909)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:65)
    at com.intellij.openapi.application.ReadActionProcessor.process(ReadActionProcessor.java:11)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processCandidates$19(PsiSearchHelperImpl.java:911)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processVirtualFile$12(PsiSearchHelperImpl.java:600)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1075)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processVirtualFile(PsiSearchHelperImpl.java:579)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processPsiFileRoots$8(PsiSearchHelperImpl.java:450)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$10(PsiSearchHelperImpl.java:521)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:200)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:184)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$11(PsiSearchHelperImpl.java:520)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:139)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:152)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:152)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1075)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:96)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:108)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:86)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:200)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:184)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:86)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
    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)

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here if needed.