-
Notifications
You must be signed in to change notification settings - Fork 70
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
in
keyword completion
#1088
Comments
It would be nice to see this fixed completely properly, but the above gives a really significant improvement, to what seems a fairly serious usability issue. |
Agreeing this would be a very nice improvement. |
If it's a snippet, should we just suggest it from the lsp server? Also, what is the difference between this workaround and just adding the keyword as a normal completion candidate? |
@rgrinberg , as I understand it, the keyword completion was expected to be context aware. This comment suggests that adding keyword completions without it is too noisy. My "solution" is a cheap attempt at helping with a common pain point that was reported by Mark and seems to affect a lot of users. I wanted to add it in the topmost "layer" of the completion stack and then wait for a proper solution. I'm unsure if hiding this kind of hack inside the lsp server is better. |
Does this issue affect every editor? If yes, then a solution in ocamllsp seems more appropriate.
No strong opinion here. We could experiment and see which ad-hoc solution works better in practice.
I don't mind a temporary hack, but I don't see the advantage of doing it in vscode if the issue affects multiple editors. Unless of course the hack proposed here is somehow different than doing it right in the server. |
The completion exception cannot easily be patched in a vscode extension, because it seems to be happening between VSCode and the LSP without the LSP client having a say. So it would be easiest to intervene somewhere in the completion logic. Except it would be kinda ugly. |
I don't think we can even say that this is a problem that only happens with VSCode. In other words, it should ideally and definitely be addressed on the LSP side. |
Scenario:
in
(very common OCaml pattern)The problem has already been discussed:
#183
ocaml/ocaml-lsp#420
The consensus seems that it takes more work to resolve this problem systemically for all OCaml keywords.
However, I have found a simple hack that resolves this specific case. It was inspired by this Stack Overflow issue.
This workaround for
in
can be implemented as:Which provides
in
autocompletion and seems much more intuitive.We can either add this snippet to
vscode-ocaml-platform
list of built-in snippets or explain this workaround in README.The text was updated successfully, but these errors were encountered: