Skip to content

Commit

Permalink
Merge pull request #38671 from dotnet/merges/release/dev16.4-preview1…
Browse files Browse the repository at this point in the history
…-to-release/dev16.4-preview1-vs-deps

Merge release/dev16.4-preview1 to release/dev16.4-preview1-vs-deps
  • Loading branch information
JoeRobich committed Sep 12, 2019
2 parents 5b67f3b + 51eae37 commit 2f21c63
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
Expand Up @@ -616,5 +616,68 @@ class B { }
";
await VerifyItemExistsAsync(markup, "A");
}

[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NullableTypeCreation()
{
var markup =
@"#nullable enable
namespace ConsoleApplication1
{
class Program
{
void M()
{
object? o;
o = new $$
}
}
}
";
await VerifyItemExistsAsync(markup, "object");
}

[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NullableTypeCreation_AssignedNull()
{
var markup =
@"#nullable enable
namespace ConsoleApplication1
{
class Program
{
void M()
{
object? o = null;
o = new $$
}
}
}
";
await VerifyItemExistsAsync(markup, "object");
}

[Fact, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task NullableTypeCreation_NestedNull()
{
var markup =
@"#nullable enable
using System.Collections.Generic;
namespace ConsoleApplication1
{
class Program
{
void M()
{
List<object?> l;
l = new $$
}
}
}
";
await VerifyItemExistsAsync(markup, "List<object?>");
}
}
}
Expand Up @@ -78,6 +78,11 @@ protected override (string displayText, string suffix, string insertionText) Get
return (symbol.Name, "", symbol.Name);
}

if (symbol is ITypeSymbol typeSymbol)
{
return base.GetDisplayAndSuffixAndInsertionText(typeSymbol.WithNullability(NullableAnnotation.None), context);
}

return base.GetDisplayAndSuffixAndInsertionText(symbol, context);
}

Expand Down

0 comments on commit 2f21c63

Please sign in to comment.