You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the MiniWDL package we're using to parse a WDL tree, validates it first. If we have "partial" input like during typing for auto-complete, it will be considered an "invalid" WDL and so it will not produce the tree to understand which context to apply the completion to.
One way to overcome this could be to not call MiniWDL upon a textDocument/completion request, but rather try to see if there's already a cached version of the tree (parsed by MiniWDL before the user started typing). If there's one, we could re-use it and understand which completion items to return back to the user, based on the cursor position in the document.
Additionally, whenever there's intent to auto-complete, we should "block" or "delay" automatic re-validation of the document (which happens every time the user "stops" typing for 500ms or more), so that we don't just display errors when the user expects something useful to return.
Another (more significant) limitation is that MiniWDL does not return "tree nodes" for every piece of WDL we'd like to auto-complete. So some syntax tokens will be entirely missed with this strategy. We could ask MiniWDL library owners to add those to the tree, but that could be quite a lot of work. I think we could start simple and see how much (if anything) needs to be amended.
The text was updated successfully, but these errors were encountered:
Currently, the MiniWDL package we're using to parse a WDL tree, validates it first. If we have "partial" input like during typing for auto-complete, it will be considered an "invalid" WDL and so it will not produce the tree to understand which context to apply the completion to.
One way to overcome this could be to not call MiniWDL upon a
textDocument/completion
request, but rather try to see if there's already a cached version of the tree (parsed by MiniWDL before the user started typing). If there's one, we could re-use it and understand which completion items to return back to the user, based on the cursor position in the document.Additionally, whenever there's intent to auto-complete, we should "block" or "delay" automatic re-validation of the document (which happens every time the user "stops" typing for 500ms or more), so that we don't just display errors when the user expects something useful to return.
Another (more significant) limitation is that MiniWDL does not return "tree nodes" for every piece of WDL we'd like to auto-complete. So some syntax tokens will be entirely missed with this strategy. We could ask MiniWDL library owners to add those to the tree, but that could be quite a lot of work. I think we could start simple and see how much (if anything) needs to be amended.
The text was updated successfully, but these errors were encountered: