-
Notifications
You must be signed in to change notification settings - Fork 199
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
OnAutoInsert Cohosting Tests #10829
OnAutoInsert Cohosting Tests #10829
Conversation
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
All text should already be in the document/buffer when OnAutoInsert is being executed. Tigger character is not being added to the buffer, it should already be in the buffer.
Switching to applying edit instead of verifying edit contents and range. Switching from Theories to separate Facts where input was complex. Other misc cleanup.
…options passed to the remove service.
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 like this change very much! Good stuff here. I only found a handful of suggestions, mostly just consistency formatting nits.
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteAutoInsertService.cs
Show resolved
Hide resolved
|
||
The end. | ||
"""; | ||
await VerifyOnAutoInsertAsync(input, output, triggerCharacter: "=", delegatedResponseText: "\"$0\""); |
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.
nit: Consider inserting a blank line above this method call to be consistent with the tests above. (Same feedback for the tests below.)
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.
David suggested just using the string with the parameter name directly in the method call. I tried that and it looks pretty good I think. I'll go with that for now, let me know if you disagree.
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
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.
Fantastic to see more testing :)
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs
Outdated
Show resolved
Hide resolved
...soft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Outdated
Show resolved
Hide resolved
.../Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs
Show resolved
Hide resolved
Diabled auto merge as there is still pending feedback. |
I think everything is addressed now. |
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 would appreciate a follow up PR.
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs
Show resolved
Hide resolved
…enizer * upstream/main: (270 commits) Fix after merge PR Feedback Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240905.1 Fix auto insert service after merge from main PR Feedback Use ImmutableArray in SourceTextDiffer too Create a helper method and revert change to shared code, just in case Convert HtmlFormatter to ImmutableArray<TextChange> IEnumarable to ImmutableArray Remove some more usage of LSP types, and simplify ranges to line numbers Use pooled collections in a few more spots Extract common code to helper method Rename some methods to Try... pattern Rename some variables etc. Fix broken tests Get all consuming code compiling again Convert TextEdit to TextChange Remove flaky test OnAutoInsert Cohosting Tests (dotnet#10829) Update GetLanguageKind(...) tests and move to Workspaces.Test ...
…o directives * upstream/features/roslyn-tokenizer: (271 commits) Reimplement IDispoasable in test clases. Fix after merge PR Feedback Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240905.1 Fix auto insert service after merge from main PR Feedback Use ImmutableArray in SourceTextDiffer too Create a helper method and revert change to shared code, just in case Convert HtmlFormatter to ImmutableArray<TextChange> IEnumarable to ImmutableArray Remove some more usage of LSP types, and simplify ranges to line numbers Use pooled collections in a few more spots Extract common code to helper method Rename some methods to Try... pattern Rename some variables etc. Fix broken tests Get all consuming code compiling again Convert TextEdit to TextChange Remove flaky test OnAutoInsert Cohosting Tests (dotnet#10829) ...
Summary of the changes