TeXiFy-IDEA: Significant parser slowdown for Latex with complex parameters

If I open the source of the tkz-tab package, the parser seems to get stuck (might be an infinite loop) on parsing some strict-keyval-pair. Perhaps you can have a look? You can find the file in your local latex distribution or at https://github.com/tkz-sty/tkz-tab/blob/master/latex/tkz-tab.sty

Screenshot_2022-06-14_17-00-14

_Originally posted by @PHPirates in https://github.com/Hannah-Sten/TeXiFy-IDEA/issues/2388#issuecomment-1155312622_

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

I don’t know what would be best, but I would appreciate if you could have a look into external rules. Yeah no hurries, I have to do a quick fix for this particular issue anyway, it’s just a matter of trying to prevent a stuck parser in the future which can be triggered by any update of any texlive package.

I think the unintuitive API could be alleviated somewhat by then parsing the key-value pairs at application level manually and then providing all the extension functions to replace the parser information - I think this would be the fallback solution if external rules don’t work out, as it’s probably the same code but then less nicely integrated with the parser.

I should note that the user story right now is that because we have sty files included in the LatexIndexableSetContributor, all these files will be parsed and hence if the parser gets stuck on one of them, the indexing gets stuck.

Parsing all these files was never the intention (though perhaps a nice test for the parser…) because it’s very slow and unnecessary (since our indexers are regex-based) and clutters the stub indices (#2433), so I will try to fix that before the next release anyway.