Beispiel #1
0
 private static string GetTooltipText(SymbolDefinition symbol, ParseTree.Leaf leaf)
 {
     if (symbol.kind == SymbolKind.Method)
     {
         var method = symbol as MethodDefinition;
         if (method != null && method.IsExtensionMethod)
         {
             var nodeLeft = leaf.parent;
             if (nodeLeft != null && nodeLeft.RuleName == "accessIdentifier")
             {
                 nodeLeft = nodeLeft.FindPreviousNode() as ParseTree.Node;
                 if (nodeLeft != null &&
                     (nodeLeft.RuleName == "primaryExpressionPart" || nodeLeft.RuleName == "primaryExpressionStart"))
                 {
                     var symbolLeft = FGResolver.GetResolvedSymbol(nodeLeft);
                     if (symbolLeft != null && symbolLeft.kind != SymbolKind.Error && !(symbolLeft is TypeDefinitionBase))
                     {
                         return(symbol.GetTooltipTextAsExtensionMethod());
                     }
                 }
             }
         }
     }
     return(symbol.GetTooltipText());
 }
Beispiel #2
0
 private static string GetTooltipText(SymbolDefinition symbol, ParseTree.Leaf leaf)
 {
     if (symbol.kind == SymbolKind.Method)
     {
         var method = symbol as MethodDefinition;
         if (method != null && method.IsExtensionMethod)
         {
             var nodeLeft = leaf.parent;
             if (nodeLeft != null && nodeLeft.RuleName == "accessIdentifier")
             {
                 nodeLeft = nodeLeft.FindPreviousNode() as ParseTree.Node;
                 if (nodeLeft != null &&
                     (nodeLeft.RuleName == "primaryExpressionPart" || nodeLeft.RuleName == "primaryExpressionStart"))
                 {
                     var symbolLeft = FGResolver.GetResolvedSymbol(nodeLeft);
                     if (symbolLeft != null && symbolLeft.kind != SymbolKind.Error && !(symbolLeft is TypeDefinitionBase))
                         return symbol.GetTooltipTextAsExtensionMethod();
                 }
             }
         }
     }
     return symbol.GetTooltipText();
 }