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

Completions don't work properly when you just start typing #52

Open
DoctorKrolic opened this issue Jul 7, 2023 · 10 comments
Open

Completions don't work properly when you just start typing #52

DoctorKrolic opened this issue Jul 7, 2023 · 10 comments

Comments

@DoctorKrolic
Copy link
Collaborator

This is better to show than explain:
Code_zmLLpQIKAE

For some reason the first letter isn't a part of completion session.

However, if you first manually trigger completions and then start typing, everything is working fine:
Code_CKiqla371r

@tintoy
Copy link
Owner

tintoy commented Jul 7, 2023

That looks odd; are you typing < to trigger the completion? I wouldn't expect just typing a property or item name to trigger completion, BTW.

I also vaguely remember a while back the VS Code completion behaviour changing and that tripped us up until we changed our implementation to compensate. I'll see if I can dig up the issue.

@tintoy
Copy link
Owner

tintoy commented Jul 7, 2023

This isn't that issue, but it is some of the history of how we (conceptually) handled completions:

tintoy/msbuild-project-tools-vscode#15

@tintoy
Copy link
Owner

tintoy commented Jul 7, 2023

Also (slightly) related in terms of unintuitive semantics:

tintoy/msbuild-project-tools-vscode#21

@tintoy
Copy link
Owner

tintoy commented Jul 7, 2023

And here is the original issue, I think:

tintoy/msbuild-project-tools-vscode#67

(this is going back a couple of years, though)

@tintoy
Copy link
Owner

tintoy commented Jul 8, 2023

BTW, logging is quite extensive if you turn on verbose logging; might help work out where behaviour is deviating from expectations.

@DoctorKrolic
Copy link
Collaborator Author

That looks odd; are you typing < to trigger the completion? I wouldn't expect just typing a property or item name to trigger completion, BTW.

Yeah, but since this has been in release versions from probably the very beginning, it would not be a pleasant user experience, if we remove this way of using completions entirely. So I guess this need a fix now.

Also triggering completions via < just doesn't work at all:
Code_mRT2F4ZBG5

As you can see, the only things that work if I type < are built-in lexical-based completions from VS code, that just suggest you words you've recently typed. Also I should clarify, that all these gifs are from latest release version, not the dev build. I am not at my work station for about 2 weeks, so don't have access to my usual dev environment for now. But I do remember that I faced this behaviour several times when testing changes for my other PRs, so all this should apply to latest builds as well

@tintoy
Copy link
Owner

tintoy commented Jul 8, 2023

Hmm, I wonder if it's an interaction between the language server's completion behaviour and how your general completion behaviour is configured in your local VSCode? Or it might just be that we have different understandings of how completions are supposed to work. I use the extension fairly frequently and I've never had issues with completions using <, so I suspect it may be one of those 2 but I'll test it out later this morning and see what I can see.

@tintoy
Copy link
Owner

tintoy commented Jul 9, 2023

Ok, so I think I can see what's happened here.

image

This feature did not exist when the language server was written so it does not take into account that there may not be a trigger character. The problem is that a completion triggered by regular typing (i.e. quick-suggestions: other) does not seem to have any sort of differentiator (in the LSP message payload from VS Code to the language service) compared to a completion triggered explicitly (e.g. Ctrl-Space). But in only one of those cases should the character at the insertion point be replaced.

I'll have to have a think about how we might be able to handle this.

@tintoy
Copy link
Owner

tintoy commented Jul 9, 2023

Also possibly related:

microsoft/vscode#185286

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

No branches or pull requests

2 participants