Now that I'm working on MwLanguageServer, to implement AST-based signature help and auto completion, language server needs some non-trivial node structures to figure out where user's caret is.
For example, if user is entering a template expression in the editor (I use $ to indicate the position of caret.
Now user want some hint on the unfinished template expression, but obviously, {{Temp itself is not a valid template expression, so WikitextParser will just parse the whole document as a huge PlainText node, and language server cannot figure out what kind of completion the user wants. This case also holds for WikiLink, and TagNode.
To fix this, we might allow some "error-handling" in WikitextParser, such as, to implicitly close the unclosed template expression, like this
and we will get a large Template node now. Though it's not accurate, the server may do some work before finding out that the user is now in a template expression, and to the left of the caret, we have Temp already entered.
Now that I'm working on MwLanguageServer, to implement AST-based signature help and auto completion, language server needs some non-trivial node structures to figure out where user's caret is.
For example, if user is entering a template expression in the editor (I use
$
to indicate the position of caret.Now user want some hint on the unfinished template expression, but obviously,
{{Temp
itself is not a valid template expression, soWikitextParser
will just parse the whole document as a hugePlainText
node, and language server cannot figure out what kind of completion the user wants. This case also holds forWikiLink
, andTagNode
.To fix this, we might allow some "error-handling" in
WikitextParser
, such as, to implicitly close the unclosed template expression, like thisand we will get a large
Template
node now. Though it's not accurate, the server may do some work before finding out that the user is now in a template expression, and to the left of the caret, we haveTemp
already entered.