提交 ae2bb5bd 编写于 作者: J Jason Malinowski

Fix missing nullable annotations in navigation bar

Fixes https://github.com/dotnet/roslyn/issues/37183
上级 6f6f1fcf
......@@ -36,7 +36,9 @@ internal class CSharpNavigationBarItemService : AbstractNavigationBarItemService
SymbolDisplayParameterOptions.IncludeName |
SymbolDisplayParameterOptions.IncludeDefaultValue |
SymbolDisplayParameterOptions.IncludeParamsRefOut,
miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes | SymbolDisplayMiscellaneousOptions.AllowDefaultLiteral);
miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes |
SymbolDisplayMiscellaneousOptions.AllowDefaultLiteral |
SymbolDisplayMiscellaneousOptions.IncludeNullableReferenceTypeModifier);
[ImportingConstructor]
public CSharpNavigationBarItemService()
......
......@@ -240,5 +240,19 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.NavigationBar
Item("M()", Glyph.MethodPrivate),
Item("M()", Glyph.MethodPrivate, grayed:=True)}))
End Function
<Fact, Trait(Traits.Feature, Traits.Features.NavigationBar), WorkItem(37183, "https://github.com/dotnet/roslyn/issues/37183")>
Public Async Function TestNullableReferenceTypesInParameters() As Task
Await AssertItemsAreAsync(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>#nullable enable
using System.Collections.Generic;
class C { void M(string? s, IEnumerable&lt;string?&gt; e) { }</Document>
</Project>
</Workspace>,
Item("C", Glyph.ClassInternal, children:={
Item("M(string? s, IEnumerable<string?> e)", Glyph.MethodPrivate)}))
End Function
End Class
End Namespace
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册