// Token: 0x06000012 RID: 18 RVA: 0x0000243C File Offset: 0x0000063C
        private ResolveResult GetLanguageItem(ProjectDocument doc, string expression, Client.SourceLocation location)
        {
            ParsedDocument parsedDocument = doc.ParsedDocument;

            if (parsedDocument == null)
            {
                return(null);
            }
            SyntaxTree           ast = parsedDocument.GetAst <SyntaxTree>();
            CSharpUnresolvedFile csharpUnresolvedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;

            if (ast == null || csharpUnresolvedFile == null)
            {
                return(null);
            }
            AstNode nodeAt = ast.GetNodeAt(location.Line, location.Column, null);

            if (nodeAt == null)
            {
                return(null);
            }
            CSharpTypeResolveContext typeResolveContext = csharpUnresolvedFile.GetTypeResolveContext(doc.Compilation, new TextLocation(location.Line, location.Column));
            CSharpResolver           resolver           = new CSharpResolver(typeResolveContext);
            CSharpAstResolver        csharpAstResolver  = new CSharpAstResolver(resolver, ast, csharpUnresolvedFile);

            csharpAstResolver.ApplyNavigator(new NodeListResolveVisitorNavigator(new AstNode[]
            {
                nodeAt
            }), CancellationToken.None);
            CSharpResolver resolverStateBefore = csharpAstResolver.GetResolverStateBefore(nodeAt, CancellationToken.None);

            return(resolverStateBefore.LookupSimpleNameOrTypeName(expression, new List <IType>(), NameLookupMode.Expression));
        }
Example #2
0
        public override ResolveResult Resolve(CSharpResolver resolver)
        {
            var typeArgs = typeArguments.Resolve(resolver.CurrentTypeResolveContext);

            return(resolver.LookupSimpleNameOrTypeName(identifier, typeArgs, lookupMode));
        }