Skip to content

Commit

Permalink
Merge pull request #62741 from CyrusNajmabadi/errorListRemoval
Browse files Browse the repository at this point in the history
Remove roslyn implementation of error list
  • Loading branch information
CyrusNajmabadi authored Mar 7, 2024
2 parents 3ab3ca7 + 9df875d commit 8c55b1f
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 1,479 deletions.
5 changes: 0 additions & 5 deletions src/EditorFeatures/Test/Diagnostics/DiagnosticServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ private static DiagnosticService GetDiagnosticService(TestWorkspace workspace)
{
var diagnosticService = Assert.IsType<DiagnosticService>(workspace.ExportProvider.GetExportedValue<IDiagnosticService>());

// These tests were originally written under the assumption that the diagnostic service will not be
// initialized with listeners. If this check ever fails, the tests that use this method should be reviewed
// for impact.
Assert.Empty(diagnosticService.GetTestAccessor().EventListenerTracker.GetTestAccessor().EventListeners);

return diagnosticService;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ internal partial class DiagnosticService : IDiagnosticService
private readonly object _gate = new();
private readonly Dictionary<IDiagnosticUpdateSource, Dictionary<Workspace, Dictionary<object, Data>>> _map = [];

private readonly EventListenerTracker<IDiagnosticService> _eventListenerTracker;

private ImmutableHashSet<IDiagnosticUpdateSource> _updateSources;

[ImportingConstructor]
Expand All @@ -42,14 +40,12 @@ public DiagnosticService(
[ImportMany] IEnumerable<Lazy<IEventListener, EventListenerMetadata>> eventListeners)
{
// we use registry service rather than doing MEF import since MEF import method can have race issue where
// update source gets created before aggregator - diagnostic service - is created and we will lose events fired before
// the aggregator is created.
// update source gets created before aggregator - diagnostic service - is created and we will lose events
// fired before the aggregator is created.
_updateSources = [];

// queue to serialize events.
_eventQueue = new TaskQueue(listenerProvider.GetListener(FeatureAttribute.DiagnosticService), TaskScheduler.Default);

_eventListenerTracker = new EventListenerTracker<IDiagnosticService>(eventListeners, WellKnownEventListeners.DiagnosticService);
}

public event EventHandler<ImmutableArray<DiagnosticsUpdatedArgs>> DiagnosticsUpdated
Expand All @@ -67,16 +63,6 @@ public event EventHandler<ImmutableArray<DiagnosticsUpdatedArgs>> DiagnosticsUpd

private void RaiseDiagnosticsUpdated(IDiagnosticUpdateSource source, ImmutableArray<DiagnosticsUpdatedArgs> argsCollection)
{
Workspace? previousWorkspace = null;
foreach (var args in argsCollection)
{
if (args.Workspace != previousWorkspace)
{
_eventListenerTracker.EnsureEventListener(args.Workspace, this);
previousWorkspace = args.Workspace;
}
}

var ev = _eventMap.GetEventHandlers<EventHandler<ImmutableArray<DiagnosticsUpdatedArgs>>>(DiagnosticsUpdatedEventName);

_eventQueue.ScheduleTask(DiagnosticsUpdatedEventName, () =>
Expand Down Expand Up @@ -415,19 +401,5 @@ public Data(UpdatedEventArgs args, ImmutableArray<DiagnosticData> diagnostics)
Diagnostics = diagnostics;
}
}

internal TestAccessor GetTestAccessor()
=> new(this);

internal readonly struct TestAccessor
{
private readonly DiagnosticService _diagnosticService;

internal TestAccessor(DiagnosticService diagnosticService)
=> _diagnosticService = diagnosticService;

internal ref readonly EventListenerTracker<IDiagnosticService> EventListenerTracker
=> ref _diagnosticService._eventListenerTracker;
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8c55b1f

Please sign in to comment.