提交 260853ac 编写于 作者: C CyrusNajmabadi 提交者: GitHub

Merge pull request #12647 from CyrusNajmabadi/navigableItemsImplicit

Navigable items can state if they are relate to implicitly declared items or not.  We want this as we will not display unreference implicitly declared nav items.
...@@ -19,9 +19,17 @@ internal interface INavigableItem ...@@ -19,9 +19,17 @@ internal interface INavigableItem
/// </summary> /// </summary>
bool DisplayFileLocation { get; } bool DisplayFileLocation { get; }
/// <summary>
/// his is intended for symbols that are ordinary symbols in the language sense, and may be
/// used by code, but that are simply declared implicitly rather than with explicit language
/// syntax. For example, a default synthesized constructor in C# when the class contains no
/// explicit constructors.
/// </summary>
bool IsImplicitlyDeclared { get; }
Document Document { get; } Document Document { get; }
TextSpan SourceSpan { get; } TextSpan SourceSpan { get; }
ImmutableArray<INavigableItem> ChildItems { get; } ImmutableArray<INavigableItem> ChildItems { get; }
} }
} }
\ No newline at end of file
...@@ -28,6 +28,12 @@ internal class DeclaredSymbolNavigableItem : INavigableItem ...@@ -28,6 +28,12 @@ internal class DeclaredSymbolNavigableItem : INavigableItem
private readonly Lazy<string> _lazyDisplayString; private readonly Lazy<string> _lazyDisplayString;
private readonly Lazy<ISymbol> _lazySymbol; private readonly Lazy<ISymbol> _lazySymbol;
/// <summary>
/// DeclaredSymbolInfos always come from some actual declaration in source. So they're
/// never implicitly declared.
/// </summary>
public bool IsImplicitlyDeclared => false;
public DeclaredSymbolNavigableItem(Document document, DeclaredSymbolInfo declaredSymbolInfo) public DeclaredSymbolNavigableItem(Document document, DeclaredSymbolInfo declaredSymbolInfo)
{ {
Document = document; Document = document;
......
...@@ -31,13 +31,9 @@ private class SymbolLocationNavigableItem : INavigableItem ...@@ -31,13 +31,9 @@ private class SymbolLocationNavigableItem : INavigableItem
public string DisplayString => _displayString; public string DisplayString => _displayString;
public Glyph Glyph public Glyph Glyph => _symbol.GetGlyph();
{
get public bool IsImplicitlyDeclared => _symbol.IsImplicitlyDeclared;
{
return _symbol.GetGlyph();
}
}
public Document Document public Document Document
{ {
...@@ -47,13 +43,7 @@ public Document Document ...@@ -47,13 +43,7 @@ public Document Document
} }
} }
public TextSpan SourceSpan public TextSpan SourceSpan => _location.SourceSpan;
{
get
{
return _location.SourceSpan;
}
}
public ImmutableArray<INavigableItem> ChildItems => ImmutableArray<INavigableItem>.Empty; public ImmutableArray<INavigableItem> ChildItems => ImmutableArray<INavigableItem>.Empty;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册