Permalink
Browse files

Merge pull request #32366 from dotnet/merges/dev16.0-preview2-to-master

Merge dev16.0-preview2 to master
  • Loading branch information...
dotnet-automerge-bot committed Jan 11, 2019
2 parents 79b9c40 + 07eee6e commit 5f275d58d206ad3d6a5e231987df955261342ea2
@@ -28,7 +28,7 @@ jobs:
_configuration: Debug
release:
_configuration: Release
timeoutInMinutes: 90
timeoutInMinutes: 135

steps:
- script: eng/cibuild.cmd -configuration $(_configuration) -prepareMachine -testVsi
@@ -270,7 +270,12 @@ function TestUsingOptimizedRunner() {
$dlls = $dlls | ?{ -not ($_.FullName -match ".*/ref/.*") }

if ($ci) {
$args += " -xml -timeout:65"
$args += " -xml"
if ($testVsi) {
$args += " -timeout:120"
} else {
$args += " -timeout:65"
}
}

$procdumpPath = Ensure-ProcDump
@@ -81,7 +81,7 @@ private async Task CheckResultAsync(bool absent, int position, CSharpSyntaxConte
}
else
{
var result = (await RecommendKeywordsAsync(position, context)).Single();
var result = (await RecommendKeywordsAsync(position, context)).SingleOrDefault();
Assert.True(result != null, "No recommended keywords");
Assert.Equal(keywordText, result.Keyword);
if (matchPriority != null)
@@ -48,9 +48,10 @@ public async Task TestNotInUsingAlias()
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestNotInEmptyStatement()
[WorkItem(32174, "https://github.com/dotnet/roslyn/issues/32174")]
public async Task TestInEmptyStatement()
{
await VerifyAbsenceAsync(AddInsideMethod(
await VerifyKeywordAsync(AddInsideMethod(
@"$$"));
}

@@ -276,12 +277,17 @@ public async Task TestNotAfterDelegate()
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[WorkItem(32214, "https://github.com/dotnet/roslyn/issues/32214")]
public async Task TestNotBetweenUsings()
{
await VerifyAbsenceAsync(AddInsideMethod(
@"using Goo;
var source = @"using Goo;
$$
using Bar;"));
using Bar;";

await VerifyWorkerAsync(source, absent: true);

// Recommendation in scripting is not stable. See https://github.com/dotnet/roslyn/issues/32214
//await VerifyWorkerAsync(source, absent: true, Options.Script);
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
@@ -343,5 +349,28 @@ public async Task TestNotAfterUsingInMethodBody()
void M() {
using $$");
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
[WorkItem(32174, "https://github.com/dotnet/roslyn/issues/32174")]
public async Task TestLocalFunction()
{
await VerifyKeywordAsync(AddInsideMethod(@" $$ void local() { }"));
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestInCase()
{
await VerifyKeywordAsync(AddInsideMethod(@"
switch (i)
{
case 0:
$$"));
}

[Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)]
public async Task TestInFor()
{
await VerifyAbsenceAsync(AddInsideMethod(@" for (int i = 0; i < 0; $$) "));
}
}
}
@@ -55,6 +55,7 @@ protected override bool IsValidContext(int position, CSharpSyntaxContext context
return
context.IsGlobalStatementContext ||
context.TargetToken.IsUsingKeywordInUsingDirective() ||
context.IsStatementContext ||
IsValidContextForType(context, cancellationToken) ||
IsValidContextForMember(context, cancellationToken);
}
@@ -149,7 +149,7 @@ internal static class DiagnosticResultSerializer

if (document?.SupportsDiagnostics() == false)
{
// drop diagnostics for document that doesn't support
// drop diagnostics for non-null document that doesn't support
// diagnostics
continue;
}
@@ -113,7 +113,12 @@ public void AddExternalSemanticDiagnostics(DocumentId documentId, IEnumerable<Di

private void AppendDiagnostics(ref Dictionary<DocumentId, List<DiagnosticData>> map, Document documentOpt, Diagnostic diagnostic)
{
if (documentOpt?.SupportsDiagnostics() == false)
if (documentOpt is null)
{
return;
}

if (!documentOpt.SupportsDiagnostics())
{
return;
}

0 comments on commit 5f275d5

Please sign in to comment.