Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement auto-completion #6

Open
dinvlad opened this issue Oct 12, 2019 · 0 comments
Open

Implement auto-completion #6

dinvlad opened this issue Oct 12, 2019 · 0 comments

Comments

@dinvlad
Copy link
Contributor

dinvlad commented Oct 12, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant