Frederisk/Wikitext-VSCode-Extension

Braces highlight mismatch

kjhf opened this issue · 2 comments

kjhf commented

Hello, thank you for your useful extension.
In more complicated template cases, braces can be mismatched. For example

{{#if:{{{param|}}}|{{{param}}}|{{ATemplate|Template arg}}}}

kjhf commented

image

This matter is more complicated, but I may not be able to solve it in a short time. VSCode's bracket matching currently does not allow the use of complex regexps to adjust. And in fact, TextMate also leads to the need to write some inefficient and difficult-to-maintain code (mainly regexp) to maintain this problem.

There are of course many other reasons, such as Parsoid's strange parsing strategy and the poor syntax of wikitext itself.

In any case, I am considering introducing LSP support, aka. Language Server Extension to solve this problem. But it’s not easy, and it may take me quite some time to focus on this issue.

As a mitigation measure, if you don't mind, you can insert comments or spaces that do not affect the semantics of the source code to alleviate this problem.