-
Notifications
You must be signed in to change notification settings - Fork 685
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
Include tooltip to Razor provisional completion #7440
Conversation
This is only if the completion is actually taken, right? Do things still work correctly otherwise? eg, type TL;DR, If the Razor document doesn't change after typing the dot, presumably the generated document never gets re-synced |
Thanks for the heads up! I did manage to get it into a "bad" state. Assuming I think I will try add and remove the provisional dot for both completion and resolveCompletion command. Thanks so much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Andrew, it would be much better if we can hook the didChange rather than use a delay. The rest makes sense, though I must admit I find this whole area confusing and hard to reason about. Could just be my TypeScript skills :)
@@ -80,6 +82,7 @@ export class CSharpProjectedDocument implements IProjectedDocument { | |||
if (this.provisionalEditAt && this.preProvisionalContent) { | |||
// Undo provisional edit if one was applied. | |||
this.setContent(this.preProvisionalContent); | |||
this.resolveProvisionalEditAt = this.provisionalEditAt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this field should be cleared in addProvisionalDotAt
, just to ensure the previous resolve index doesn't stick around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is right now the resolve completion request doesn't know whether the completion request was provisional or not. So one bad state could be:
-> (Provisional completion) user triggers provisional completion
-> (resolve completion) provisional dot are added and removed as the user toggles completion list
-> (regular completion) as the user continues to type, completion list shows up
-> (resolve completion) provisional dot are added and removed still since the field is not cleared
This resolves #7250. The cause was that when we added a provisional dot to the generated virtual csharp document, the change didn't get reflected on disk before the Roslyn server took the completion request.
Changes made in completionHandler.ts:
provideCompletionsCommand
(roslyn.provideCompletions).Before
What could have gone wrong if it wasn't for David's comment
Screen.Recording.2024-08-14.at.3.23.43.PM.mov
After
Screen.Recording.2024-08-15.at.9.45.26.AM.mov