Closed jwfxpr closed 1 year ago
I'm not sure what version of the extension is running on your device, but the problem didn't happen on mine. By the way, the latest version now publicly available is v3.8.0.
... which must be at the start of a line to be interpreted as a table.
This has been done a long time ago.
This is on the latest released version, 3.8.0. The screenshot snippet above is from that version.
I have since noticed that this behaviour only seems to occur when wikitext is pasted into an open buffer, rather than when a file on disk is opened, or the text is typed in. This is my main workflow for using this extension: Copy-paste wiki source into the editor, work on it, copy-paste it back to the wiki interface, save.
It's weird. I'm using the Insiders v1.79.0 of VSCode, and I can't reproduce this issue. This looks more like some sort of issue with VSCode.
Oh that's interesting. I'm using the current stable vscode, 1.78.2.
I guess we wait and see if the 1.79 fixes the behaviour. I'll try to update this issue then either way, with a much more definite reproducable example if necessary. 😊
Thanks for taking the time to look into it!
With a little further investigation, I've tracked this down to an unexpected interaction with another extension! Sorry for the confusion and thanks again for the time spent.
Currently, the bracket highlighting treats
|}
as a special digraph, which is appropriate when handling tables. Wikitext tables are demarked by an opening{|
and closing|}
, which must be at the start of a line to be interpreted as a table.These two characters also appear frequently in non-lua template code, especially when handling parameters in parser functions. E.g.,
This example evaluates to
First unnamed parameter has no value
if the first unnamed parameter has no value.Currently, the extension will sometimes incorrectly interpret the
|}
here as a table closure, leading to incorrect and confusing bracket matching in templates which use this technique:The more complex the template, the more this error compounds, leading the extension to be counterproductive when handling the most complex templates (which is where it should be most relied upon).
Restricting the
|}
table closure symbol matching to the start of a line would eliminate this issue. 😊