Skip to content
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

Merged
merged 4 commits into from
Mar 24, 2024

Conversation

CyrusNajmabadi
Copy link
Member

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.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 22, 2024 05:18
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 22, 2024
@CyrusNajmabadi CyrusNajmabadi requested a review from mavasani March 22, 2024 05:18
private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = EditorTestCompositions.EditorFeatures
.AddExcludedPartTypes(typeof(IDiagnosticUpdateSourceRegistrationService))
.AddParts(typeof(MockDiagnosticUpdateSourceRegistrationService));
private static readonly TestComposition s_compositionWithMockDiagnosticUpdateSourceRegistrationService = EditorTestCompositions.EditorFeatures;
Copy link
Member Author

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.

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
Copy link
Member Author

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>());
Copy link
Member Author

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]
Copy link
Member Author

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

@CyrusNajmabadi
Copy link
Member Author

@mavasani ptal.

@CyrusNajmabadi
Copy link
Member Author

@mavasani ptal

@CyrusNajmabadi CyrusNajmabadi merged commit e510ed1 into dotnet:main Mar 24, 2024
27 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the removeDiagService branch March 24, 2024 06:39
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 24, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants