-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Contained document refactoring #41283
base: main
Are you sure you want to change the base?
Conversation
@jasonmalinowski @KirillOsenkov Still work in progress, but wanted to gather initial feedback to see if this is going the right direction. |
072c8a5
to
16def78
Compare
Our goal is for the bulk of this code to land in a non-VisualStudio layer and still work. For reference here's the MonoDevelop copy of the code: I would love to kill it and move to the same shared implementation. Adding @ToddGrun and @DavidKarlas FYI. Also my advice: cover it with unit-tests. That logic is gnarly. |
I'll add some unit tests. I found we had some that were commented out :-/ I do not have understanding what the expected behavior should be though, so it might be better if someone who knows added more tests afterwards. |
I guess nobody knows this code so you own it now :) The way I'd approach it is put a breakpoint in that code, run a simple ASP.NET Core app, open a .cshtml file, hit Return. This will trigger the breakpoint. Capture the inputs that go into here and the outputs and that should be enough to give a decent coverage. |
@KirillOsenkov I think i'm gonna give up on adding the tests. I can't figure out how to set up the projection buffers :(. |
No worries, but I thought there are quite a few methods that just deal with strings. Maybe at least try for those? |
Also I was thinking maybe @ToddGrun or @NTaylorMullen would be interested to help? This is a worthy and important effort. |
Definitely sounds worthy! If only I had the bandwidth 😢 |
16def78
to
ad75e87
Compare
If anyone can describe what is the layering of projection buffers and their content types that the VS actually creates, I could use that info to set up the buffers in the tests. |
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.
Comments so far.
src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Test/Venus/ContainedDocumentTests_AdjustIndentation.vb
Outdated
Show resolved
Hide resolved
src/VisualStudio/LiveShare/Impl/Client/Razor/CSharpLspContainedLanguageProvider.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Test/Venus/ContainedDocumentTests_UpdateText.vb
Outdated
Show resolved
Hide resolved
f4e8d4f
to
9241594
Compare
9241594
to
8925302
Compare
This is precisely why we needed to terraform this code and cover it with tests ;) Thanks for doing this. Maybe if @NTaylorMullen is busy he can at least help with answering questions, or perhaps @ToddGrun. Or who could we ask? |
Fixes #28322