Ejemplo n.º 1
0
        private bool DoGetTheTarget(string text, int offset, MockTargetDatabase database)
        {
            var parser = new CsParser.Parser();
            CsGlobalNamespace globals = parser.Parse(text);

            var locals = new CsParser.LocalsParser();
            CsMember context = AutoComplete.FindDeclaration(globals, offset) as CsMember;
            var nameResolver = new ResolveName(context, database, locals, text, offset, globals);
            var resolver = new ResolveExpr(database, globals, nameResolver);

            m_target = resolver.Resolve(context, text, offset);
            return m_target != null;
        }
Ejemplo n.º 2
0
        private bool DoGetTarget(string text, string target, int offset, MockTargetDatabase database)
        {
            Log.WriteLine("AutoComplete", "{0} {1} {2}", new string('*', 10), new StackTrace().GetFrame(1).GetMethod().Name, new string('*', 10));

            var parser = new CsParser.Parser();
            CsGlobalNamespace globals = parser.Parse(text);

            var locals = new CsParser.LocalsParser();
            CsMember context = AutoComplete.FindDeclaration(globals, offset) as CsMember;
            var resolver = new ResolveName(context, database, locals, text, offset, globals);

            m_target = resolver.Resolve(target);
            return m_target != null;
        }
Ejemplo n.º 3
0
        private bool DoGetTarget(string text, string name, int offset, MockTargetDatabase database)
        {
            //Console.WriteLine("------------------------------------");
            //Console.WriteLine(name);
            //Console.WriteLine(text);

            var parser = new CsParser.Parser();
            CsGlobalNamespace globals = parser.Parse(text);

            var locals = new CsParser.LocalsParser();
            CsMember context = AutoComplete.FindDeclaration(globals, offset) as CsMember;
            var resolver = new ResolveName(context, database, locals, text, offset, globals);

            m_target = resolver.Resolve(name);
            return m_target != null;
        }