Skip to content

Commit

Permalink
Apply code review feedback to Quick Info PR
Browse files Browse the repository at this point in the history
This commit has a few significant changes beyond correcting minor nit picks:

1. It unifies the GlyphExtensions classes in the Workspaces and non-WPF EditorFeatures layers.
2. It significantly cleans up the super-ugly mocking code in QuickInfoControlTests.vb
3. Tweaks the QuickInfo API to remove QuickInfoItem.Empty and QuickInfoItem.IsEmpty properties.
  • Loading branch information
DustinCampbell committed Feb 15, 2018
1 parent 6b9f0c4 commit 0c10f4b
Show file tree
Hide file tree
Showing 33 changed files with 279 additions and 580 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ private async Task TestWithOptionsAsync(TestWorkspace workspace, params Action<Q
private async Task TestWithOptionsAsync(Document document, QuickInfoService service, int position, Action<QuickInfoItem>[] expectedResults)
{
var info = await service.GetQuickInfoAsync(document, position, cancellationToken: CancellationToken.None);
Assert.NotNull(info);

if (expectedResults.Length == 0)
{
Assert.True(info.IsEmpty);
Assert.Null(info);
}
else
{
Assert.NotNull(info);

foreach (var expected in expectedResults)
{
expected(info);
Expand Down Expand Up @@ -91,14 +92,14 @@ private async Task VerifyWithMscorlib45Async(string markup, Action<QuickInfoItem

var info = await service.GetQuickInfoAsync(document, position, cancellationToken: CancellationToken.None);

Assert.NotNull(info);

if (expectedResults.Length == 0)
{
Assert.True(info.IsEmpty);
Assert.Null(info);
}
else
{
Assert.NotNull(info);

foreach (var expected in expectedResults)
{
expected(info);
Expand Down Expand Up @@ -237,14 +238,14 @@ private async Task VerifyWithReferenceWorkerAsync(string xmlString, params Actio

var info = await service.GetQuickInfoAsync(document, position, cancellationToken: CancellationToken.None);

Assert.NotNull(info);

if (expectedResults.Length == 0)
{
Assert.True(info.IsEmpty);
Assert.Null(info);
}
else
{
Assert.NotNull(info);

foreach (var expected in expectedResults)
{
expected(info);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Immutable;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Wpf;
using Microsoft.VisualStudio.Imaging.Interop;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Wpf;
using Microsoft.VisualStudio.Imaging;
using Microsoft.VisualStudio.Imaging.Interop;
Expand All @@ -16,7 +15,7 @@ internal class DefaultImageMonikerService : IImageMonikerService

public bool TryGetImageMoniker(ImmutableArray<string> tags, out ImageMoniker imageMoniker)
{
var glyph = tags.GetGlyph();
var glyph = tags.GetFirstGlyph();

// We can't do the compositing of these glyphs at the editor layer. So just map them
// to the non-add versions.
Expand Down
284 changes: 0 additions & 284 deletions src/EditorFeatures/Core/Shared/Extensions/GlyphExtensions.cs

This file was deleted.

Loading

0 comments on commit 0c10f4b

Please sign in to comment.