Implemented Lingo 3.1.2 (836982a) from distributor for 1.38.2. Works fine except cases when the string is followed by a space and a round bracket, such as vl is given tooltip, vl (2) is not. https://www.violinwiki.org/wiki/Musical_instruments_used_in_combination_with_violin
Topic on Extension talk:Lingo
As I can see, "vl (2)" term is not present on https://www.violinwiki.org/mediawiki/index.php?title=Terminology, but "vl" is. Therefore, the tooltip does appear when you are hovering over the "vl" part of the string and does not when you are hovering over the " (2)".
Correct vl (2) is not the term. vl is the term, 2 in brackets is numbering. There is a space between vl and the bracket. But the defect is that the tooltip does not appear when you hover over vl that is followed by the bracket. Examples under heading Examples of standard instrumentations or line "2 fl trans solo, vl (2), vla, b, cor (2)"
The issue looks a bit oscillating, when I checked your page a week ago, I saw the tooltip as expected, I made a screenshot https://drive.google.com/file/d/1DumO8Duo8lP0W90pkH0mGXHeJ8MhKt-r/view?usp=share_link
Quick tests show that the problem perhaps is unrelated to "space+bracket" pattern, look at https://www.violinwiki.org/wiki/User:WikiVisor (only certain terms fail). Will take it for a closer look and update.
You are welcome to do as many tests you need, it might be useful for other users as well. At https://www.violinwiki.org/wiki/User:WikiVisor I see vl (2) and cor (2) as issue but tb (2) shows tooltip correctly.
It seems like it happens where it has a partial match where there is some prefix that would be a match, and there is some additional suffix that would be a match, but the actual text is in the middle, which confuses lingo.
In the particular case - "vl" matches and "vl solo" would also be a match. However, in the case of "vl (2)", lingo matches up to "vl " (vl followed by a space) but after the space, fails to match anything further. Instead of falling back to "vl" it gives up there. So that's why "vl" matches (newline and space are considered differnt) and "vl(2)" would match, but "vl (2)" does not.
Anyways, there is a patch for this issue at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Lingo/+/886439
p.s. I noticed https://www.violinwiki.org/wiki/Terminology has text "This page is not part of main but because of Lingo it has to be in Main.". Just FYI you can change the name of the terminology page by editing the page MediaWiki:lingo-terminologypagename to have whatever name you want.
Sorry guys, could not give you proper test result yet, implemented Lingo 3.1.2 (836982a) from distributor for 1.38.2, the patch is for 1.39 and production environment will not go to 1.39.
Fwiw, nothing in that patch is 1.39 specific. You could probably just make the same changes to an older version of Lingo
Done. a. 836982a install kept, updated src/Tree.php with 886439. Results so far so good. b. updated MediaWiki:lingo-terminologypagename to a template, good as well (I had some trouble during initial tests, no problems now).