Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Feb 10, 2022
1 parent a975b07 commit a36dcc3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class C

Dim listenerProvider = workspace.ExportProvider.GetExportedValue(Of IAsynchronousOperationListenerProvider)

Dim context = New FindReferencesTests.TestContext(workspace.GlobalOptions)
Dim context = New FindReferencesTests.TestContext()
Dim commandHandler = New FindReferencesCommandHandler(
New MockStreamingFindReferencesPresenter(context),
workspace.GlobalOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.FindReferences
Assert.NotNull(startDocument)

Dim findRefsService = startDocument.GetLanguageService(Of IFindUsagesService)
Dim context = New TestContext(workspace.GlobalOptions)
Dim context = New TestContext()
Await findRefsService.FindReferencesAsync(context, startDocument, cursorPosition, CancellationToken.None)

Dim expectedDefinitions =
Expand Down Expand Up @@ -224,10 +224,13 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.FindReferences
Public ReadOnly Definitions As List(Of DefinitionItem) = New List(Of DefinitionItem)()
Public ReadOnly References As List(Of SourceReferenceItem) = New List(Of SourceReferenceItem)()

Public Sub New(globalOptions As IGlobalOptionService)
MyBase.New(globalOptions)
Public Sub New()
End Sub

Public Overrides Function GetOptionsAsync(language As String, cancellationToken As CancellationToken) As ValueTask(Of FindUsagesOptions)
Return ValueTaskFactory.FromResult(FindUsagesOptions.Default)
End Function

Public Function ShouldShow(definition As DefinitionItem) As Boolean
If References.Any(Function(r) r.Definition Is definition) Then
Return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private abstract class AbstractTableDataSourceFindUsagesContext :

public readonly StreamingFindUsagesPresenter Presenter;
private readonly IFindAllReferencesWindow _findReferencesWindow;
private readonly IGlobalOptionService _globalOptions;
protected readonly IWpfTableControl2 TableControl;

private readonly AsyncBatchingWorkQueue<(int current, int maximum)> _progressQueue;
Expand Down Expand Up @@ -117,12 +118,12 @@ protected AbstractTableDataSourceFindUsagesContext(
IGlobalOptionService globalOptions,
bool includeContainingTypeAndMemberColumns,
bool includeKindColumn)
: base(globalOptions)
{
presenter.AssertIsForeground();

Presenter = presenter;
_findReferencesWindow = findReferencesWindow;
_globalOptions = globalOptions;
TableControl = (IWpfTableControl2)findReferencesWindow.TableControl;
TableControl.GroupingsChanged += OnTableControlGroupingsChanged;

Expand Down Expand Up @@ -157,6 +158,9 @@ protected AbstractTableDataSourceFindUsagesContext(
CancellationTokenSource.Token);
}

public override ValueTask<FindUsagesOptions> GetOptionsAsync(string language, CancellationToken cancellationToken)
=> ValueTaskFactory.FromResult(_globalOptions.GetFindUsagesOptions(language));

private static ImmutableArray<string> SelectCustomColumnsToInclude(ImmutableArray<ITableColumnDefinition> customColumns, bool includeContainingTypeAndMemberColumns, bool includeKindColumn)
{
var customColumnsToInclude = ArrayBuilder<string>.GetInstance();
Expand Down

0 comments on commit a36dcc3

Please sign in to comment.