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; }
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; }
private bool DoGetTarget(string text, string name, int offset) { var database = new MockTargetDatabase(); return DoGetTarget(text, name, offset, database); }
private bool DoGetTarget(string text, int offset) { Log.WriteLine("AutoComplete", "{0} {1} {2}", new string('-', 10), new StackTrace().GetFrame(1).GetMethod().Name, new string('-', 10)); var database = new MockTargetDatabase(); return DoGetTheTarget(text, offset, database); }
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; }