Exemple #1
0
        private static ImmutableDictionary <string, string> GetProperties(ISymbol definition, bool isPrimary)
        {
            var properties = ImmutableDictionary <string, string> .Empty;

            if (isPrimary)
            {
                properties = properties.Add(DefinitionItem.Primary, "");
            }

            var rqName = RQNameInternal.From(definition);

            if (rqName != null)
            {
                properties = properties.Add(DefinitionItem.RQNameKey1, rqName);
            }

            if (definition?.IsConstructor() == true)
            {
                // If the symbol being considered is a constructor include the containing type in case
                // a third party wants to navigate to that.
                rqName = RQNameInternal.From(definition.ContainingType);
                if (rqName != null)
                {
                    properties = properties.Add(DefinitionItem.RQNameKey2, rqName);
                }
            }

            return(properties);
        }
Exemple #2
0
 /// <summary>
 /// Returns an RQName for the given symbol, or <code>null</code>if the symbol cannot be represented by an RQName.
 /// </summary>
 /// <param name="symbol">The symbol to build an RQName for.</param>
 /// <returns>A string suitable to pass as the pszRQName argument to methods in <see cref="IVsRefactorNotify"/>
 /// and <see cref="IVsSymbolicNavigationNotify"/>.</returns>
 public static string From(ISymbol symbol)
 => RQNameInternal.From(symbol);