Example #1
0
 public static string GetName(VBAParser.IdentifierContext context, out Interval tokenInterval)
 {
     tokenInterval = Interval.Of(context.Start.TokenIndex, context.Stop.TokenIndex);
     return(GetName(context));
 }
Example #2
0
 public static string GetName(VBAParser.IdentifierContext context)
 {
     return(GetName(GetIdentifierValueContext(context)));
 }
Example #3
0
 public static Selection GetNameSelection(VBAParser.IdentifierContext context)
 {
     return(GetIdentifierValueContext(context).GetSelection());
 }
Example #4
0
        private (Declaration declaration, bool mightHaveSetType) SetTypeDeterminingDeclarationOfExpression(VBAParser.IdentifierContext identifier, QualifiedModuleName containingModule, DeclarationFinder finder)
        {
            var declaration = finder.IdentifierReferences(identifier, containingModule)
                              .Select(reference => reference.Declaration)
                              .LastOrDefault();

            return(declaration, MightHaveSetType(declaration));
        }
Example #5
0
 public static VBAParser.TypeHintContext GetTypeHintContext(VBAParser.IdentifierContext identifier)
 {
     return(identifier.untypedIdentifier() != null
         ? null
         : identifier.typedIdentifier().typeHint());
 }
Example #6
0
        public static string GetTypeHintValue(VBAParser.IdentifierContext identifier)
        {
            var typeHintContext = GetTypeHintContext(identifier);

            return(typeHintContext?.GetText());
        }