-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove legacy IDiagnosticService #72660
Conversation
private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = EditorTestCompositions.EditorFeatures | ||
.AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService)) | ||
.AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService)); | ||
private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = EditorTestCompositions.EditorFeatures; |
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.
note: the names of this compositions need to change.
...torFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs
Outdated
Show resolved
Hide resolved
…iver/DiagnosticAnalyzerDriverTests.cs
using Roslyn.Utilities; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript; | ||
|
||
[Export(typeof(IVSTypeScriptDiagnosticService)), Shared] | ||
[method: ImportingConstructor] | ||
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
internal sealed class VSTypeScriptDiagnosticService(IDiagnosticService service) : IVSTypeScriptDiagnosticService | ||
internal sealed class VSTypeScriptDiagnosticService() : IVSTypeScriptDiagnosticService |
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 the only place that actually takes the events from IDiagnosticService and forwards them along. But it's only for "push style" diagnostics, which we've moved off of, and which TS also definitely does not want. @MariaSolOs for awareness. this should go nicely with yoru move to LSP pull diags.
@@ -49,7 +47,6 @@ public async Task TestGetFirstDiagnosticWithFixAsync() | |||
"; | |||
using var workspace = TestWorkspace.CreateCSharp(code, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService, openDocuments: true); | |||
|
|||
Assert.IsType<MockDiagnosticUpdateSourceRegistrationService>(workspace.GetService<IDiagnosticUpdateSourceRegistrationService>()); |
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.
tons of asserts taht tests were actually not even using actual product code...
@@ -39,8 +39,7 @@ private static string Inspect(DiagnosticData d) | |||
(!string.IsNullOrWhiteSpace(d.DataLocation.UnmappedFileSpan.Path) ? $" {d.DataLocation.UnmappedFileSpan.Path}({d.DataLocation.UnmappedFileSpan.StartLinePosition.Line}, {d.DataLocation.UnmappedFileSpan.StartLinePosition.Character}, {d.DataLocation.UnmappedFileSpan.EndLinePosition.Line}, {d.DataLocation.UnmappedFileSpan.EndLinePosition.Character}):" : "") + | |||
$" {d.Message}"; | |||
|
|||
[Theory] | |||
[CombinatorialData] | |||
[Theory, CombinatorialData, Obsolete] |
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.
Obsolete needed as this tests the obsolete constructor of EnCUpdateSource
@mavasani ptal. |
@mavasani ptal |
The only client even listening for the events from this is TS. Note: they are moving to LSP pull diags. So i'm goign to wait on them to get that in, then remove all of this. Tagging @MariaSolOs as well.