-
Notifications
You must be signed in to change notification settings - Fork 196
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
Rybrande/o#upgrade v2 #2439
Rybrande/o#upgrade v2 #2439
Conversation
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs
Outdated
Show resolved
Hide resolved
...zor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/DefaultLSPDocumentManager.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/AutoFlushingNerdbankStream.cs
Show resolved
Hide resolved
...est/Microsoft.AspNetCore.Razor.LanguageServer.Common.Test/BackgroundDocumentGeneratorTest.cs
Outdated
Show resolved
Hide resolved
...oft.VisualStudio.LanguageServerClient.Razor/DefaultRazorLanguageServerCustomMessageTarget.cs
Show resolved
Hide resolved
...oft.VisualStudio.LanguageServerClient.Razor/DefaultRazorLanguageServerCustomMessageTarget.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs
Outdated
Show resolved
Hide resolved
...c/Microsoft.AspNetCore.Razor.LanguageServer/Microsoft.AspNetCore.Razor.LanguageServer.csproj
Outdated
Show resolved
Hide resolved
...c/Microsoft.AspNetCore.Razor.LanguageServer/Completion/DefaultTagHelperDescriptionFactory.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.
Looks good! Nothing major. Some questions and the rest of it is just cleanups.
...c/Microsoft.AspNetCore.Razor.LanguageServer/Completion/DefaultTagHelperDescriptionFactory.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentVersionCache.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRazorConfigurationService.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/RazorDefinitionEndpoint.cs
Outdated
Show resolved
Hide resolved
...oft.VisualStudio.LanguageServerClient.Razor/DefaultRazorLanguageServerCustomMessageTarget.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/RazorLanguageServerClient.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.RazorExtension/AssemblyBindingRedirects.cs
Outdated
Show resolved
Hide resolved
...est/Microsoft.AspNetCore.Razor.LanguageServer.Common.Test/BackgroundDocumentGeneratorTest.cs
Outdated
Show resolved
Hide resolved
...est/Microsoft.AspNetCore.Razor.LanguageServer.Common.Test/BackgroundDocumentGeneratorTest.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer.Common/LanguageServerConstants.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.RazorExtension/AssemblyBindingRedirects.cs
Outdated
Show resolved
Hide resolved
// OldVersionLowerBound = "8.0.0.0", | ||
// OldVersionUpperBound = "8.1.0.0", | ||
// NewVersion = "8.1.0.0")] | ||
[assembly: ProvideBindingRedirection( |
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.
This definitely isn't ideal. @david-driscoll is this requirement introduced based on a dependency that O# depends on outside of our control?
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 think I've bumped all of Msft.Ext to 3.1
I'm not using any new features so technically they can drop back down to 2.1 if you need.
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 think that would be really helpful for us, otherwise we need this redirect and it might cause big problems.
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.
Is this something we can get access to early? Only asking because it's gonna be an ngen pain to insert this 😄
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.
Does this apply to logging as well, or just DI?
Currently we have these:
<PackageReference Update="Microsoft.Extensions.Logging" Version="3.1.0" />
<PackageReference Update="Microsoft.Extensions.Logging.Abstractions" Version="3.1.0" />
<PackageReference Update="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="3.1.0" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
I can drop all or some of them. down to 2.1 or 2.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.
So we don't necessarily care about which version they are as long as the dependency graph is coherent. Given we run our language server in VS which is a .NET framework app it relies on a hugeeee set of binding redirects to ensure that every dependency uses the correct version of a dll; however, every time we have to include a binding redirect we essentially restrict what versions of an assembly can exist for other teams because we then binding redirect it to our own. Hope that makes sense 😄
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.
If you hit me up on Teams or Slack I can figure out the best solution.
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.
If this works for you guys, heres the proposed change: OmniSharp/csharp-language-server-protocol#342
src/Razor/src/Microsoft.VisualStudio.RazorExtension/AssemblyCodeBases.cs
Show resolved
Hide resolved
...Razor/src/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.RazorExtension/source.extension.vsixmanifest
Show resolved
Hide resolved
0790f9b
to
c1e3064
Compare
throw new ArgumentNullException(nameof(documentUri)); | ||
} | ||
|
||
return documentUri.ToUri().GetAbsoluteOrUNCPath(); |
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 know this is still doing ToUri and creating additional objects, but getting the detection of UNC and absolute paths correct is harder than I think we want to deal with in this PR, to I used extension methods to wrap everything so we can deal with it later.
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.
ya that's fine
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.
DocumentUri should support unc and other paths, it's based off the vscode implementation with a suite of tests. This was important for @TylerLeonhardt .
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.
This test suite was shamelessly pilfered from vscode. And there are some additional ones as well just ensuring it works with various different character types.
If there is one thing I'm an expert of, I'm not an expert of anything (I'm not...) it's converting C# to TypeScript. or TypeScript to C#, lol.
{ | ||
if (documentSnapshot == null) | ||
{ | ||
throw new ArgumentNullException(nameof(documentSnapshot)); | ||
} | ||
|
||
if (version < 0) | ||
if (version is null) |
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.
We basically already had the null version handling, it was just using -1, so I converted anywhere that handled -1 to use int?
🆙📅 |
@@ -65,9 +66,17 @@ internal class RazorFormattingEndpoint : IDocumentFormattingHandler, IDocumentRa | |||
_logger = loggerFactory.CreateLogger<RazorFormattingEndpoint>(); | |||
} | |||
|
|||
public TextDocumentRegistrationOptions GetRegistrationOptions() | |||
DocumentRangeFormattingRegistrationOptions IRegistration<DocumentRangeFormattingRegistrationOptions>.GetRegistrationOptions() |
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.
Access modifiers
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.
This is actually not allowed because this method is set to only show when the object is accessed as a IRegistration<DocumentRangeFormattingRegistrationOptions>
, further modifiers are forbidden.
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorDocumentSynchronizationEndpoint.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.
LGTM
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.
👏 👏 👏 👏 👏
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs
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.
Requesting changes mostly because we can't break WTE without more thought
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRazorConfigurationService.cs
Outdated
Show resolved
Hide resolved
throw new ArgumentNullException(nameof(documentUri)); | ||
} | ||
|
||
return documentUri.ToUri().GetAbsoluteOrUNCPath(); |
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.
ya that's fine
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentUriExtensions.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/DefaultLSPDocument.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/VirtualDocument.cs
Outdated
Show resolved
Hide resolved
// OldVersionLowerBound = "8.0.0.0", | ||
// OldVersionUpperBound = "8.1.0.0", | ||
// NewVersion = "8.1.0.0")] | ||
[assembly: ProvideBindingRedirection( |
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.
Is this something we can get access to early? Only asking because it's gonna be an ngen pain to insert this 😄
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorDiagnosticsPublisherTest.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorDiagnosticsPublisherTest.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorDocumentSynchronizationEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorDocumentSynchronizationEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/LSPDocument.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/DefaultLSPDocument.cs
Outdated
Show resolved
Hide resolved
fa34670
to
61ffa9e
Compare
Hello @ryanbrandenburg! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
dc1cce7
to
671cfbe
Compare
This reverts commit 6a84cf5. # Conflicts: # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CodeBlockDirectiveFormattingPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DefaultRazorFormattingService.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContentValidationPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingPassBase.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/OnTypeFormattingStructureValidationPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RazorComponentRenameEndpoint.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingContentValidationPassTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingLanguageServerClient.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/OnTypeFormattingStructureValidationPassTest.cs
* Revert "Rybrande/o#upgrade v2 (#2439)" This reverts commit 6a84cf5. # Conflicts: # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CodeBlockDirectiveFormattingPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DefaultRazorFormattingService.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContentValidationPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingPassBase.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/OnTypeFormattingStructureValidationPass.cs # src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RazorComponentRenameEndpoint.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingContentValidationPassTest.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingLanguageServerClient.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingTestBase.cs # src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/OnTypeFormattingStructureValidationPassTest.cs * Addressed code review comments and commented out all formatting tests.
Fixes https://github.com/dotnet/aspnetcore/issues/20320.
This is a huge change with lots to clean up, putting it up early so yall can play with it, but let me know if you find any functional or code-style problems.