private int GetEnum(NavInfoList navInfoList, bool isObjectBrowser, bool isCanonical, ref ImmutableArray<IVsNavInfoNode> nodeList, out IVsEnumNavInfoNodes ppEnum) { if (nodeList == null) { var builder = ImmutableArray.CreateBuilder<IVsNavInfoNode>(); FillNodeList(navInfoList, isObjectBrowser, isCanonical, builder); nodeList = builder.ToImmutable(); } ppEnum = new EnumNavInfoNodes(nodeList); return VSConstants.S_OK; }
private int GetEnum(NavInfoList navInfoList, bool isObjectBrowser, bool isCanonical, ref ImmutableArray <IVsNavInfoNode> nodeList, out IVsEnumNavInfoNodes ppEnum) { if (nodeList == null) { var builder = ImmutableArray.CreateBuilder <IVsNavInfoNode>(); FillNodeList(navInfoList, isObjectBrowser, isCanonical, builder); nodeList = builder.ToImmutable(); } ppEnum = new EnumNavInfoNodes(nodeList); return(VSConstants.S_OK); }
public NavInfo( Guid libraryGuid, __SymbolToolLanguage preferredLanguage, string libraryName, string metadataProjectItem = null, string namespaceName = null, string className = null, string memberName = null) { metadataProjectItem = metadataProjectItem ?? string.Empty; namespaceName = namespaceName ?? string.Empty; className = className ?? string.Empty; memberName = memberName ?? string.Empty; _preferredLanguage = preferredLanguage; _navInfo = new NavInfoList(libraryGuid, libraryName, metadataProjectItem, namespaceName, className, memberName, expandNames: false); _canonicalNavInfo = new NavInfoList(libraryGuid, libraryName, metadataProjectItem, namespaceName, className, memberName, expandNames: true); }
public NavInfo( Guid libraryGuid, __SymbolToolLanguage preferredLanguage, string libraryName, string metadataProjectItem = null, string namespaceName = null, string className = null, string memberName = null) { metadataProjectItem = metadataProjectItem ?? string.Empty; namespaceName = namespaceName ?? string.Empty; className = className ?? string.Empty; memberName = memberName ?? string.Empty; _preferredLanguage = preferredLanguage; _navInfo = new NavInfoList(libraryGuid, libraryName, metadataProjectItem, namespaceName, className, memberName, expandNames: false); _canonicalNavInfo = new NavInfoList(libraryGuid, libraryName, metadataProjectItem, namespaceName, className, memberName, expandNames: true); }
private void FillNodeList(NavInfoList navInfoList, bool isObjectBrowser, bool isCanonical, ImmutableArray<IVsNavInfoNode>.Builder builder) { var index = 0; // In some cases, Class View presentation NavInfo objects will have extra nodes (LLT_PACKAGE & LLT_HIERARCHY) up front. // When this NavInfo is consumed by Object Browser (for 'Browse to Definition'), we need to skip first two nodes if (isObjectBrowser && !isCanonical) { if (navInfoList.Count >= 2 && navInfoList[1].ListType == (uint)_LIB_LISTTYPE.LLT_HIERARCHY) { index = 2; } } while (index < navInfoList.Count) { if (!isCanonical || navInfoList[index].ListType != (uint)_LIB_LISTTYPE.LLT_HIERARCHY) { builder.Add(navInfoList[index]); } index++; } }
private void FillNodeList(NavInfoList navInfoList, bool isObjectBrowser, bool isCanonical, ImmutableArray <IVsNavInfoNode> .Builder builder) { var index = 0; // In some cases, Class View presentation NavInfo objects will have extra nodes (LLT_PACKAGE & LLT_HIERARCHY) up front. // When this NavInfo is consumed by Object Browser (for 'Browse to Definiition'), we need to skip first two nodes if (isObjectBrowser && !isCanonical) { if (navInfoList.Count >= 2 && navInfoList[1].ListType == (uint)_LIB_LISTTYPE.LLT_HIERARCHY) { index = 2; } } while (index < navInfoList.Count) { if (!isCanonical || navInfoList[index].ListType != (uint)_LIB_LISTTYPE.LLT_HIERARCHY) { builder.Add(navInfoList[index]); } index++; } }