intellij-latte icon indicating copy to clipboard operation
intellij-latte copied to clipboard

Editing big template creates LatteMacroLexer exception and the whole PhpStorm freezes

Open vojtechkrocan opened this issue 3 years ago • 1 comments

Describe the bug I was rewriting some legacy plain PHP code to Latte template so I pasted the whole code to the template then I added some Latte comments. After that I started editting the code line after line to make it valid Latte file. In that moment PhpStorm freezed for couple of minutes (1:20 according to logs). After unfreeze PhpStorm freezes everytime I try to edit the template. Unfortunately I have no idea which part of the template creates the exception because debugging is very annoying.

I also tried downgrading to previous PhpStorm version and also downgrading to the previous plugin versions but with no effect.

PhpStorm log: WARN - com.intellij.lexer.FlexAdapter - com.jantvrdik.intellij.latte.lexer.LatteMacroLexer java.lang.Error: Error: could not match input

Environment:

  • PhpStorm version 2021.2.2, 2021.3
  • Plugin version 1.1.4, 1.1.3, 1.1.0
  • OS version MacOS 12.0.1

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

  1. Open given template in PhpStorm
  2. Edit random part of the template

Code In the attached file.

Additional context The original code is legacy and really messy - that was the reason to put it in the template.

overview.latte.zip

vojtechkrocan avatar Dec 21 '21 16:12 vojtechkrocan

Maybe it will be resolved in next version

mesour avatar Sep 24 '23 00:09 mesour