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

Merge Features/quick info party into master-vs-deps #26003

Merged
merged 104 commits into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
66920bb
General API variant
mattwar Aug 11, 2016
2eead77
make tests compile
mattwar Sep 1, 2016
f97475e
simpler QuickInfo API
mattwar Sep 2, 2016
785efef
merge with master and fix conflicts
mattwar Sep 2, 2016
3f9aa4d
removal of old or unused code & declarations
mattwar Sep 2, 2016
3b09c7d
Merge remote-tracking branch 'dotnet/master' into QuickInfoAPI2
mattwar Sep 12, 2016
1493c75
merge with master and fix conflicts
mattwar Sep 12, 2016
f447083
fix feedback issues
mattwar Sep 12, 2016
698362c
Merge remote-tracking branch 'dotnet/master' into QuickInfoAPI2
mattwar Sep 13, 2016
c48e203
use extension manager for providers
mattwar Sep 13, 2016
90cb667
Change to list of text blocks
mattwar Sep 14, 2016
1590e67
Use QuickInfoService.GetService
mattwar Sep 14, 2016
c68bf9f
merge with master and fix conflicts
mattwar Jan 4, 2017
752abba
Merge branch 'QuickInfoAPI2' of https://github.com/mattwar/roslyn int…
DustinCampbell Jun 29, 2017
61666b2
Merge branch 'master' into new-quick-info-api
DustinCampbell Jul 6, 2017
df0d315
Lots of clean up and code review feedback addressed
DustinCampbell Jul 6, 2017
d4771bf
Merge branch 'master' into new-quick-info-api
DustinCampbell Jul 11, 2017
a598588
Rename QuickInfoTextBlock -> QuickInfoSection
DustinCampbell Jul 11, 2017
c4e1902
Clean up CommonSemanticQuickInfoProvider
DustinCampbell Jul 11, 2017
63b3c9d
Move IndentationHelper.IsWhitespace(...) logic to TestLine.IsEmptyOrW…
DustinCampbell Jul 11, 2017
27212a7
Merge branch 'master' into new-quick-info-api
DustinCampbell Sep 19, 2017
5fcbad6
Merge branch 'master' into new-quick-info-api
DustinCampbell Dec 4, 2017
17167d0
Merge branch 'master' into new-quick-info-api
DustinCampbell Dec 5, 2017
03d737c
Remove unnecessary public constructors
DustinCampbell Dec 5, 2017
03461bb
Expose public Quick Info API
DustinCampbell Dec 5, 2017
27223c3
Merge branch 'master' into new-quick-info-api
DustinCampbell Dec 9, 2017
efd4f84
Update localization files
DustinCampbell Dec 9, 2017
6a75337
Add QuickInfoContext and make QuickInfoProvider internal
DustinCampbell Dec 11, 2017
3cd46e3
Merge branch 'master' into new-quick-info-api
DustinCampbell Jan 2, 2018
11ca68d
Fix build break in Quick Info unit tests and add traits
DustinCampbell Jan 3, 2018
2aa272e
Merge branch 'master' into new-quick-info-api
DustinCampbell Jan 17, 2018
144266e
Merge remote-tracking branch 'upstream/features/quick-info-party' int…
DustinCampbell Feb 14, 2018
083e2d2
Clean up unintentionally changed files
DustinCampbell Feb 14, 2018
27cf44d
Add initial changes from code review feedback
DustinCampbell Feb 14, 2018
6b9f0c4
Obsolete CompletionTags in favor or WellKnownTags
DustinCampbell Feb 14, 2018
0c10f4b
Apply code review feedback to Quick Info PR
DustinCampbell Feb 15, 2018
b9f774b
Revert some unintentional changes that snuck into this branch
DustinCampbell Feb 15, 2018
8985690
Merge pull request #20554 from DustinCampbell/new-quick-info-api
DustinCampbell Feb 16, 2018
e321e06
Merge pull request #24882 from dotnet/dev15.7.x-vs-deps
DustinCampbell Feb 16, 2018
58a7294
quick info async replacement #1
JieCarolHu Feb 21, 2018
c274c43
part #2
JieCarolHu Feb 21, 2018
10ff1fe
QuickInfoCommandHandlerAndSourceProvider.cs
JieCarolHu Feb 21, 2018
11842d3
remove Controller_InvokeQuickInfo.cs
JieCarolHu Feb 21, 2018
5f32eb6
presenter
JieCarolHu Feb 22, 2018
864bee8
event hookup
JieCarolHu Feb 22, 2018
6ac8164
ConvertQuickInfoItem
JieCarolHu Feb 22, 2018
fb4e06f
up IQuickInfoPresenterSession
JieCarolHu Feb 22, 2018
27c9e12
working
JieCarolHu Feb 23, 2018
1df17b4
code clean up
JieCarolHu Feb 23, 2018
d8667b6
clean up
JieCarolHu Feb 23, 2018
3bde231
clean up
JieCarolHu Feb 23, 2018
72765e5
clean up
JieCarolHu Feb 23, 2018
3c77620
clean up
JieCarolHu Feb 24, 2018
deb93bf
clean up
JieCarolHu Feb 24, 2018
9e4a88b
update tests
JieCarolHu Feb 26, 2018
ca0fa36
update tests
JieCarolHu Feb 26, 2018
054fbed
update tests
JieCarolHu Feb 27, 2018
b2cb6a8
not using wpf for quickinfo
JieCarolHu Feb 28, 2018
06db22c
deleting presenter
JieCarolHu Mar 1, 2018
eb1e78f
delete Core.wpf\QuickInfo\Presentation
JieCarolHu Mar 2, 2018
3c835c4
Icon
JieCarolHu Mar 2, 2018
b67f75d
merge dev15.7.x-vs-deps
JieCarolHu Mar 2, 2018
fd64fb2
fix merge
JieCarolHu Mar 2, 2018
0661bd9
Merge branch 'features/quick-info-party' into quickInfoAsync3
JieCarolHu Mar 2, 2018
21404e0
handle image
JieCarolHu Mar 2, 2018
ecc5b65
build first line with Wrapped style
JieCarolHu Mar 2, 2018
9f3085f
remove usings
JieCarolHu Mar 5, 2018
c89d128
disabled failed tests temporarily to get build working
JieCarolHu Mar 5, 2018
f3090b6
Skip failed event hookup tests temporarily to get build working
JieCarolHu Mar 5, 2018
4002d05
fix test
JieCarolHu Mar 6, 2018
866bb24
remove unused imports
JieCarolHu Mar 6, 2018
9904916
code clean up
JieCarolHu Mar 8, 2018
b39b95e
rename QuickInfoCommandHandlerAndSourceProvider to QuickInfoSourcePr…
JieCarolHu Mar 8, 2018
22a7884
delete InvokeQuickInfoCommandArgs.cs
JieCarolHu Mar 8, 2018
51edc81
revert ModelComputation.cs
JieCarolHu Mar 8, 2018
c6bad55
deleted controller
JieCarolHu Mar 8, 2018
134d432
fix test
JieCarolHu Mar 8, 2018
f11abb0
delete src/EditorFeatures/Core/Extensibility/QuickInfo/*.*
JieCarolHu Mar 8, 2018
7a98036
remove the inheritance from QuickInfoSourceProvider to ForegroundThre…
JieCarolHu Mar 8, 2018
44aadca
Use the quickInfoItem.Span, not the line span
JieCarolHu Mar 9, 2018
6ba85f5
fixing PR comments
JieCarolHu Mar 12, 2018
8cd52d5
Use Assert.Collection()
JieCarolHu Mar 12, 2018
d10e731
rename enum item name FunctionID.GET_QUICKINFO_ASYNC
JieCarolHu Mar 12, 2018
1feb696
fixed PR comments
JieCarolHu Mar 13, 2018
8fde77f
delete dead file
JieCarolHu Mar 13, 2018
6967897
Merge pull request #25181 from JieCarolHu/quickInfoAsync3
JieCarolHu Mar 14, 2018
6398095
merge dev15.7.x-vs-deps
JieCarolHu Mar 16, 2018
5d81ca2
re-enable tests
JieCarolHu Mar 16, 2018
07f3799
tooltip
JieCarolHu Mar 16, 2018
be2dcc1
remove usings
JieCarolHu Mar 16, 2018
5caf601
use string[] to unblock tests for now
JieCarolHu Mar 16, 2018
cfa7697
format
JieCarolHu Mar 16, 2018
f09aae5
only generate tooltip if it is not already shown (_toolTipPresenter =…
JieCarolHu Mar 16, 2018
8bf8c67
PR comments
JieCarolHu Mar 19, 2018
d4549ca
PR comments
JieCarolHu Mar 19, 2018
59c7316
use MEF to get EventHookupSessionManager
JieCarolHu Mar 21, 2018
cede85f
remove trailing whitespaces
JieCarolHu Mar 21, 2018
c2c3925
merge master-vs-deps
JieCarolHu Mar 27, 2018
65611bd
Merge pull request #25484 from JieCarolHu/tooltips
Mar 28, 2018
f77b8d9
merge quick-info-party
JieCarolHu Mar 28, 2018
bf5bd6f
Merge pull request #25776 from JieCarolHu/quickInfoMergeMasterVsDeps
Mar 28, 2018
6a8b150
upgrade to 15.8 editor nuget to fix MEF issue in unit test
JieCarolHu Apr 6, 2018
f04559a
merge quick info again
JieCarolHu Apr 20, 2018
4e1db8a
revert an accidental change
JieCarolHu Apr 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions build/Targets/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,25 @@
<MicrosoftVisualStudioCodeAnalysisSdkUIVersion>15.0.26730-alpha</MicrosoftVisualStudioCodeAnalysisSdkUIVersion>
<MicrosoftVisualStudioComponentModelHostVersion>15.0.26730-alpha</MicrosoftVisualStudioComponentModelHostVersion>
<MicrosoftVisualStudioCompositionVersion>15.5.23</MicrosoftVisualStudioCompositionVersion>
<MicrosoftVisualStudioCoreUtilityVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioCoreUtilityVersion>15.8.238-preview</MicrosoftVisualStudioCoreUtilityVersion>
<MicrosoftVisualStudioDebuggerEngineVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerEngineVersion>
<MicrosoftVisualStudioDebuggerMetadataVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerMetadataVersion>
<MicrosoftVisualStudioDebuggerUIInterfacesVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerUIInterfacesVersion>
<MicrosoftVisualStudioDebuggerInterop100Version>10.0.30319</MicrosoftVisualStudioDebuggerInterop100Version>
<MicrosoftVisualStudioDesignerInterfacesVersion>1.1.4322</MicrosoftVisualStudioDesignerInterfacesVersion>
<MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>15.0.26730-alpha</MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>
<MicrosoftVisualStudioEditorVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioEditorVersion>15.8.238-preview</MicrosoftVisualStudioEditorVersion>
<MicrosoftVisualStudioGraphModelVersion>15.0.26730-alpha</MicrosoftVisualStudioGraphModelVersion>
<MicrosoftVisualStudioImageCatalogVersion>15.0.26730-alpha</MicrosoftVisualStudioImageCatalogVersion>
<MicrosoftVisualStudioImagingVersion>15.0.26730-alpha</MicrosoftVisualStudioImagingVersion>
<MicrosoftVisualStudioImagingInterop140DesignTimeVersion>15.0.25726-Preview5</MicrosoftVisualStudioImagingInterop140DesignTimeVersion>
<MicrosoftVisualStudioInteractiveWindowVersion>2.0.0-rc3-61304-01</MicrosoftVisualStudioInteractiveWindowVersion>
<MicrosoftVisualStudioLanguageCallHierarchyVersion>15.3.1710.203</MicrosoftVisualStudioLanguageCallHierarchyVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioLanguageIntellisenseVersion>15.8.238-preview</MicrosoftVisualStudioLanguageIntellisenseVersion>
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>15.8.238-preview</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
<MicrosoftVisualStudioLanguageStandardClassificationVersion>15.8.238-preview</MicrosoftVisualStudioLanguageStandardClassificationVersion>
<MicrosoftVisualStudioOLEInteropVersion>7.10.6070</MicrosoftVisualStudioOLEInteropVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioPlatformVSEditorVersion>15.8.238-preview</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioProgressionCodeSchemaVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionCodeSchemaVersion>
<MicrosoftVisualStudioProgressionCommonVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionCommonVersion>
<MicrosoftVisualStudioProgressionInterfacesVersion>15.0.26730-alpha</MicrosoftVisualStudioProgressionInterfacesVersion>
Expand All @@ -120,11 +120,11 @@
<MicrosoftVisualStudioShellInterop90Version>9.0.30729</MicrosoftVisualStudioShellInterop90Version>
<MicrosoftVisualStudioTelemetryVersion>15.0.26730-alpha</MicrosoftVisualStudioTelemetryVersion>
<MicrosoftVisualStudioTemplateWizardInterfaceVersion>8.0.0.0-alpha</MicrosoftVisualStudioTemplateWizardInterfaceVersion>
<MicrosoftVisualStudioTextDataVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>15.7.153-preview-g7d0635149a</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextDataVersion>15.8.238-preview</MicrosoftVisualStudioTextDataVersion>
<MicrosoftVisualStudioTextInternalVersion>15.8.238-preview</MicrosoftVisualStudioTextInternalVersion>
<MicrosoftVisualStudioTextLogicVersion>15.8.238-preview</MicrosoftVisualStudioTextLogicVersion>
<MicrosoftVisualStudioTextUIVersion>15.8.238-preview</MicrosoftVisualStudioTextUIVersion>
<MicrosoftVisualStudioTextUIWpfVersion>15.8.238-preview</MicrosoftVisualStudioTextUIWpfVersion>
<MicrosoftVisualStudioTextManagerInteropVersion>7.10.6070</MicrosoftVisualStudioTextManagerInteropVersion>
<MicrosoftVisualStudioTextManagerInterop100Version>10.0.30319</MicrosoftVisualStudioTextManagerInterop100Version>
<MicrosoftVisualStudioTextManagerInterop120Version>12.0.30110</MicrosoftVisualStudioTextManagerInterop120Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Editor.CSharp.QuickInfo;
using Microsoft.CodeAnalysis.Editor.UnitTests.QuickInfo;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.QuickInfo;
using Roslyn.Test.Utilities;
using Roslyn.Utilities;
using Xunit;
Expand All @@ -20,24 +20,24 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.QuickInfo
{
public class SemanticQuickInfoSourceTests : AbstractSemanticQuickInfoSourceTests
{
private async Task TestWithOptionsAsync(CSharpParseOptions options, string markup, params Action<object>[] expectedResults)
private async Task TestWithOptionsAsync(CSharpParseOptions options, string markup, params Action<QuickInfoItem>[] expectedResults)
{
using (var workspace = TestWorkspace.CreateCSharp(markup, options))
{
await TestWithOptionsAsync(workspace, expectedResults);
}
}

private async Task TestWithOptionsAsync(TestWorkspace workspace, params Action<object>[] expectedResults)
private async Task TestWithOptionsAsync(TestWorkspace workspace, params Action<QuickInfoItem>[] expectedResults)
{
var testDocument = workspace.DocumentWithCursor;
var position = testDocument.CursorPosition.GetValueOrDefault();
var documentId = workspace.GetDocumentId(testDocument);
var document = workspace.CurrentSolution.GetDocument(documentId);

var provider = new SemanticQuickInfoProvider();
var service = QuickInfoService.GetService(document);

await TestWithOptionsAsync(document, provider, position, expectedResults);
await TestWithOptionsAsync(document, service, position, expectedResults);

// speculative semantic model
if (await CanUseSpeculativeSemanticModelAsync(document, position))
Expand All @@ -50,34 +50,30 @@ private async Task TestWithOptionsAsync(TestWorkspace workspace, params Action<o
edit.Apply();
}

await TestWithOptionsAsync(document, provider, position, expectedResults);
await TestWithOptionsAsync(document, service, position, expectedResults);
}
}

private async Task TestWithOptionsAsync(Document document, SemanticQuickInfoProvider provider, int position, Action<object>[] expectedResults)
private async Task TestWithOptionsAsync(Document document, QuickInfoService service, int position, Action<QuickInfoItem>[] expectedResults)
{
var state = await provider.GetItemAsync(document, position, cancellationToken: CancellationToken.None);
if (state != null)
{
WaitForDocumentationComment(state.Content);
}
var info = await service.GetQuickInfoAsync(document, position, cancellationToken: CancellationToken.None);

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

foreach (var expected in expectedResults)
{
expected(state.Content);
expected(info);
}
}
}

private async Task VerifyWithMscorlib45Async(string markup, Action<object>[] expectedResults)
private async Task VerifyWithMscorlib45Async(string markup, Action<QuickInfoItem>[] expectedResults)
{
var xmlString = string.Format(@"
<Workspace>
Expand All @@ -94,37 +90,33 @@ private async Task VerifyWithMscorlib45Async(string markup, Action<object>[] exp
var documentId = workspace.Documents.Where(d => d.Name == "SourceDocument").Single().Id;
var document = workspace.CurrentSolution.GetDocument(documentId);

var provider = new SemanticQuickInfoProvider();
var service = QuickInfoService.GetService(document);

var state = await provider.GetItemAsync(document, position, cancellationToken: CancellationToken.None);
if (state != null)
{
WaitForDocumentationComment(state.Content);
}
var info = await service.GetQuickInfoAsync(document, position, cancellationToken: CancellationToken.None);

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

foreach (var expected in expectedResults)
{
expected(state.Content);
expected(info);
}
}
}
}

protected override async Task TestAsync(string markup, params Action<object>[] expectedResults)
protected override async Task TestAsync(string markup, params Action<QuickInfoItem>[] expectedResults)
{
await TestWithOptionsAsync(Options.Regular, markup, expectedResults);
await TestWithOptionsAsync(Options.Script, markup, expectedResults);
}

protected async Task TestWithUsingsAsync(string markup, params Action<object>[] expectedResults)
private async Task TestWithUsingsAsync(string markup, params Action<QuickInfoItem>[] expectedResults)
{
var markupWithUsings =
@"using System;
Expand All @@ -135,13 +127,13 @@ protected async Task TestWithUsingsAsync(string markup, params Action<object>[]
await TestAsync(markupWithUsings, expectedResults);
}

protected Task TestInClassAsync(string markup, params Action<object>[] expectedResults)
private Task TestInClassAsync(string markup, params Action<QuickInfoItem>[] expectedResults)
{
var markupInClass = "class C { " + markup + " }";
return TestWithUsingsAsync(markupInClass, expectedResults);
}

protected Task TestInMethodAsync(string markup, params Action<object>[] expectedResults)
private Task TestInMethodAsync(string markup, params Action<QuickInfoItem>[] expectedResults)
{
var markupInMethod = "class C { void M() { " + markup + " } }";
return TestWithUsingsAsync(markupInMethod, expectedResults);
Expand All @@ -151,7 +143,7 @@ private async Task TestWithReferenceAsync(string sourceCode,
string referencedCode,
string sourceLanguage,
string referencedLanguage,
params Action<object>[] expectedResults)
params Action<QuickInfoItem>[] expectedResults)
{
await TestWithMetadataReferenceHelperAsync(sourceCode, referencedCode, sourceLanguage, referencedLanguage, expectedResults);
await TestWithProjectReferenceHelperAsync(sourceCode, referencedCode, sourceLanguage, referencedLanguage, expectedResults);
Expand All @@ -168,7 +160,7 @@ private async Task TestWithMetadataReferenceHelperAsync(
string referencedCode,
string sourceLanguage,
string referencedLanguage,
params Action<object>[] expectedResults)
params Action<QuickInfoItem>[] expectedResults)
{
var xmlString = string.Format(@"
<Workspace>
Expand All @@ -193,7 +185,7 @@ private async Task TestWithProjectReferenceHelperAsync(
string referencedCode,
string sourceLanguage,
string referencedLanguage,
params Action<object>[] expectedResults)
params Action<QuickInfoItem>[] expectedResults)
{
var xmlString = string.Format(@"
<Workspace>
Expand All @@ -219,7 +211,7 @@ private async Task TestInSameProjectHelperAsync(
string sourceCode,
string referencedCode,
string sourceLanguage,
params Action<object>[] expectedResults)
params Action<QuickInfoItem>[] expectedResults)
{
var xmlString = string.Format(@"
<Workspace>
Expand All @@ -236,33 +228,29 @@ private async Task TestInSameProjectHelperAsync(
await VerifyWithReferenceWorkerAsync(xmlString, expectedResults);
}

private async Task VerifyWithReferenceWorkerAsync(string xmlString, params Action<object>[] expectedResults)
private async Task VerifyWithReferenceWorkerAsync(string xmlString, params Action<QuickInfoItem>[] expectedResults)
{
using (var workspace = TestWorkspace.Create(xmlString))
{
var position = workspace.Documents.First(d => d.Name == "SourceDocument").CursorPosition.Value;
var documentId = workspace.Documents.First(d => d.Name == "SourceDocument").Id;
var document = workspace.CurrentSolution.GetDocument(documentId);

var provider = new SemanticQuickInfoProvider();
var service = QuickInfoService.GetService(document);

var state = await provider.GetItemAsync(document, position, cancellationToken: CancellationToken.None);
if (state != null)
{
WaitForDocumentationComment(state.Content);
}
var info = await service.GetQuickInfoAsync(document, position, cancellationToken: CancellationToken.None);

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

foreach (var expected in expectedResults)
{
expected(state.Content);
expected(info);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Editor.CSharp.QuickInfo;
using Microsoft.CodeAnalysis.Editor.QuickInfo;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.CSharp.QuickInfo;
using Microsoft.CodeAnalysis.Editor.UnitTests.QuickInfo;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.QuickInfo;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
Expand Down Expand Up @@ -260,9 +259,9 @@ await TestInMethodAndScriptAsync(
{");
}

private IQuickInfoProvider CreateProvider(TestWorkspace workspace)
private QuickInfoProvider CreateProvider(TestWorkspace workspace)
{
return new SyntacticQuickInfoProvider();
return new CSharpSyntacticQuickInfoProvider();
}

protected override async Task AssertNoContentAsync(
Expand All @@ -271,7 +270,7 @@ protected override async Task AssertNoContentAsync(
int position)
{
var provider = CreateProvider(workspace);
Assert.Null(await provider.GetItemAsync(document, position, CancellationToken.None));
Assert.Null(await provider.GetQuickInfoAsync(new QuickInfoContext(document, position, CancellationToken.None)));
}

protected override async Task AssertContentIsAsync(
Expand All @@ -282,14 +281,15 @@ protected override async Task AssertContentIsAsync(
string expectedDocumentationComment = null)
{
var provider = CreateProvider(workspace);
var state = await provider.GetItemAsync(document, position, cancellationToken: CancellationToken.None);
Assert.NotNull(state);

var hostingControlFactory = workspace.GetService<DeferredContentFrameworkElementFactory>();

var viewHostingControl = (ViewHostingControl)hostingControlFactory.CreateElement(state.Content);
var actualContent = viewHostingControl.GetText_TestOnly();
Assert.Equal(expectedContent, actualContent);
var info = await provider.GetQuickInfoAsync(new QuickInfoContext(document, position, CancellationToken.None));
Assert.NotNull(info);

Assert.NotEqual(0, info.RelatedSpans.Length);
var tabSize = document.Project.Solution.Workspace.Options.GetOption(Microsoft.CodeAnalysis.Formatting.FormattingOptions.TabSize, document.Project.Language);
var text = await document.GetTextAsync();
var spans = IndentationHelper.GetSpansWithAlignedIndentation(text, info.RelatedSpans, tabSize);
var actualText = string.Concat(spans.Select(s => text.GetSubText(s).ToString()));
Assert.Equal(expectedContent, actualText);
}

protected override Task TestInMethodAsync(string code, string expectedContent, string expectedDocumentationComment = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task TestAtRoot_Interactive()
await VerifyAbsenceAsync(SourceCodeKind.Script,
@"$$");
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotInUsingAlias()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Editor.Wpf;
using Microsoft.CodeAnalysis.Tags;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Imaging.Interop;
using Microsoft.VisualStudio.Language.Intellisense;
using Roslyn.Utilities;
Expand All @@ -30,7 +32,7 @@ public CustomCommitCompletion(
// extra allocation is avoided.
_completionPresenterSession = completionPresenterSession;
this.CompletionItem = completionItem;
_imageMoniker = ImageMonikers.GetImageMoniker(CompletionItem.Tags);
_imageMoniker = ImageMonikers.GetFirstImageMoniker(CompletionItem.Tags);
}

public void Commit()
Expand Down Expand Up @@ -73,7 +75,7 @@ public override IEnumerable<CompletionIcon> AttributeIcons
{
get
{
if (this.CompletionItem.Tags.Contains(CompletionTags.Warning))
if (this.CompletionItem.Tags.Contains(WellKnownTags.Warning))
{
return new[] { new CompletionIcon2(Glyph.CompletionWarning.GetImageMoniker(), s_glyphCompletionWarning, s_glyphCompletionWarning) };
}
Expand Down
Loading