提交 0116b53e 编写于 作者: C Cyrus Najmabadi

Fix tests

上级 2500ab70
......@@ -23,11 +23,5 @@ internal interface ITodoListProvider
event EventHandler<TodoItemsUpdatedArgs> TodoListUpdated;
ImmutableArray<TodoCommentData> GetTodoItems(Workspace workspace, DocumentId documentId, CancellationToken cancellationToken);
/// <summary>
/// Get current buckets stored our todo items are grouped into. Specific buckets can be retrieved by calling
/// <see cref="GetTodoItems"/>.
/// </summary>
ImmutableArray<TodoItemBucket> GetTodoItemBuckets(Workspace workspace, CancellationToken cancellationToken);
}
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
namespace Microsoft.CodeAnalysis.Editor
{
internal readonly struct TodoItemBucket
{
/// <summary>
/// The identity of bucket group.
/// </summary>
public readonly object Id;
/// <summary>
/// <see cref="Workspace"/> this bucket is associated with.
/// </summary>
public readonly Workspace Workspace;
/// <summary>
/// <see cref="ProjectId"/> this bucket is associated with, or <see langword="null"/>.
/// </summary>
public readonly ProjectId? ProjectId;
/// <summary>
/// <see cref="DocumentId"/> this bucket is associated with, or <see langword="null"/>.
/// </summary>
public readonly DocumentId? DocumentId;
public TodoItemBucket(object id, Workspace workspace, ProjectId? projectId, DocumentId? documentId)
{
Id = id;
Workspace = workspace;
ProjectId = projectId;
DocumentId = documentId;
}
}
}
......@@ -82,8 +82,6 @@ public TableDataSource(Workspace workspace, ITodoListProvider todoListProvider,
_todoListProvider = todoListProvider;
_todoListProvider.TodoListUpdated += OnTodoListUpdated;
PopulateInitialData(workspace, _todoListProvider);
}
public override string DisplayName => ServicesVSResources.CSharp_VB_Todo_List_Table_Data_Source;
......@@ -146,12 +144,6 @@ public override IEnumerable<TodoTableItem> Order(IEnumerable<TodoTableItem> grou
.ThenBy(d => d.Data.OriginalColumn);
}
private void PopulateInitialData(Workspace workspace, ITodoListProvider todoListService)
{
foreach (var bucket in todoListService.GetTodoItemBuckets(workspace, cancellationToken: CancellationToken.None))
OnDataAddedOrChanged(new TodoItemsUpdatedArgs(bucket.Id, bucket.Workspace, solution: null, bucket.ProjectId, bucket.DocumentId, ImmutableArray<TodoCommentData>.Empty));
}
private void OnTodoListUpdated(object sender, TodoItemsUpdatedArgs e)
{
if (_workspace != e.Workspace)
......
......@@ -211,13 +211,6 @@ public ImmutableArray<TodoCommentData> GetTodoItems(Workspace workspace, Documen
: ImmutableArray<TodoCommentData>.Empty;
}
public ImmutableArray<TodoItemBucket> GetTodoItemBuckets(
Workspace workspace, CancellationToken cancellationToken)
{
// Don't need to implement this. OOP pushes all items over to VS. So there's no need
return SpecializedCollections.EmptyEnumerable<UpdatedEventArgs>();
}
/// <summary>
/// Callback from the OOP service back into us.
/// </summary>
......
......@@ -390,10 +390,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
Return Items.Where(Function(t) t.DocumentId Is documentId).ToImmutableArrayOrEmpty()
End Function
Public Function GetTodoItemsUpdatedEventArgs(workspace As Workspace, cancellationToken As CancellationToken) As IEnumerable(Of UpdatedEventArgs) Implements ITodoListProvider.GetTodoItemsUpdatedEventArgs
Return Items.Select(Function(t) New UpdatedEventArgs(Tuple.Create(Me, t.DocumentId), workspace, t.DocumentId.ProjectId, t.DocumentId)).ToImmutableArray()
End Function
Public Sub RaiseTodoListUpdated(workspace As Workspace)
Dim map = Items.ToLookup(Function(t) t.DocumentId)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册