public LanguageItemCollection CtrlSpace(IParserContext parserService, int caretLine, int caretColumn, string fileName) { LanguageItemCollection result = new LanguageItemCollection(); this.parserService = parserService; IParseInformation parseInfo = parserService.GetParseInformation(fileName); JRefactory.Parser.AST.CompilationUnit fileCompilationUnit = parseInfo.MostRecentCompilationUnit.Tag as JRefactory.Parser.AST.CompilationUnit; if (fileCompilationUnit == null) { return(null); } lookupTableVisitor = new LookupTableVisitor(); lookupTableVisitor.Visit(fileCompilationUnit, null); JavaVisitor cSharpVisitor = new JavaVisitor(); cu = (ICompilationUnit)cSharpVisitor.Visit(fileCompilationUnit, null); if (cu != null) { callingClass = GetInnermostClass(); // Console.WriteLine("CallingClass is " + callingClass == null ? "null" : callingClass.Name); } foreach (string name in lookupTableVisitor.variables.Keys) { ArrayList variables = (ArrayList)lookupTableVisitor.variables[name]; if (variables != null && variables.Count > 0) { foreach (LocalLookupVariable v in variables) { if (IsInside(new Point(caretColumn, caretLine), v.StartPos, v.EndPos)) { result.Add(v); break; } } } } if (callingClass != null) { result = ListMembers(result, callingClass); } string n = ""; result.AddRange(parserService.GetNamespaceContents(n)); foreach (IUsing u in cu.Usings) { if (u != null && (u.Region == null || u.Region.IsInside(caretLine, caretColumn))) { foreach (string name in u.Usings) { result.AddRange(parserService.GetNamespaceContents(name)); } foreach (string alias in u.Aliases.Keys) { result.Add(alias); } } } return(result); }
public static Dictionary <string, List <LocalLookupVariable> > GetLookupTableWithParams(this MethodDeclaration md) { LookupTableVisitor v = new LookupTableVisitor(SupportedLanguage.CSharp, true); md.AcceptVisitor(v, null); return(v.Variables); }
public NRefactoryResolver(ProjectDom dom, ICompilationUnit unit, SupportedLanguage lang, MonoDevelop.Ide.Gui.TextEditor editor, string fileName) { if (dom == null) { throw new ArgumentNullException("dom"); } this.unit = unit; this.dom = dom; this.lang = lang; this.editor = editor; this.fileName = fileName; this.lookupTableVisitor = new LookupTableVisitor(lang); }
public override bool Extract() { using (var parser = ParserFactory.CreateParser(SupportedLanguage.CSharp, new StringReader("class Tmp { void Test() {\n " + this.textEditor.SelectedText + "\n}}"))) { parser.Parse(); if (parser.Errors.Count > 0) { MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.ParseErrors}"); return(false); } this.specialsList = parser.Lexer.SpecialTracker.RetrieveSpecials(); } this.currentProjectContent = ParserService.GetProjectContent(ProjectService.CurrentProject); MethodDeclaration newMethod = new MethodDeclaration(); List <VariableDeclaration> possibleReturnValues = new List <VariableDeclaration>(); List <VariableDeclaration> otherReturnValues = new List <VariableDeclaration>(); // Initialise new method newMethod.Body = GetBlock(this.textEditor.SelectedText); newMethod.Body.StartLocation = new Location(0, 0); this.parentNode = GetParentMember(start, end); Dom.IMember member = GetParentMember(textEditor, textEditor.Caret.Line, textEditor.Caret.Column); if (parentNode == null || member == null) { MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.InvalidSelection}"); return(false); } this.currentClass = member.DeclaringType; ErrorKind kind = CheckForJumpInstructions(newMethod); if (kind != ErrorKind.None) { switch (kind) { case ErrorKind.ContainsBreak: MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.ContainsBreakError}"); break; case ErrorKind.ContainsContinue: MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.ContainsContinueError}"); break; case ErrorKind.ContainsGoto: MessageService.ShowError("${res:AddIns.SharpRefactoring.ExtractMethod.ContainsGotoError}"); break; } return(false); } newMethod.Modifier = parentNode.Modifier; newMethod.Modifier &= ~(Modifiers.Internal | Modifiers.Protected | Modifiers.Private | Modifiers.Public | Modifiers.Override); LookupTableVisitor ltv = new LookupTableVisitor(SupportedLanguage.CSharp); parentNode.AcceptVisitor(ltv, null); var variablesList = (from list in ltv.Variables.Values from item in list select new Variable(item)) .Where(v => !(v.StartPos > end || v.EndPos < start) && (HasReferencesInSelection(newMethod, v) || HasOccurrencesAfter(CSharpNameComparer, this.parentNode, end, v.Name, v.StartPos, v.EndPos))) .Union(FromParameters(newMethod)) .Select(va => ResolveVariable(va)); foreach (var variable in variablesList) { LoggingService.Debug(variable); bool hasOccurrencesAfter = HasOccurrencesAfter(CSharpNameComparer, this.parentNode, end, variable.Name, variable.StartPos, variable.EndPos); bool isInitialized = (variable.Initializer != null) ? !variable.Initializer.IsNull : false; bool hasAssignment = HasAssignment(newMethod, variable); if (IsInCurrentSelection(variable.StartPos) && hasOccurrencesAfter) { possibleReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type)); otherReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type)); } if (!(IsInCurrentSelection(variable.StartPos) || IsInCurrentSelection(variable.EndPos))) { ParameterDeclarationExpression newParam = null; if ((hasOccurrencesAfter && isInitialized) || variable.WasRefParam) { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.Ref); } else { if ((hasOccurrencesAfter && hasAssignment) || variable.WasOutParam) { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.Out); } else { if (!hasOccurrencesAfter) { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.None); } else { if (!hasOccurrencesAfter && !isInitialized) { newMethod.Body.Children.Insert(0, new LocalVariableDeclaration(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type))); } else { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.In); } } } } if (newParam != null) { newMethod.Parameters.Add(newParam); } } } List <VariableDeclaration> paramsAsVarDecls = new List <VariableDeclaration>(); this.beforeCallDeclarations = new List <LocalVariableDeclaration>(); for (int i = 0; i < otherReturnValues.Count - 1; i++) { VariableDeclaration varDecl = otherReturnValues[i]; paramsAsVarDecls.Add(varDecl); ParameterDeclarationExpression p = new ParameterDeclarationExpression(varDecl.TypeReference, varDecl.Name); p.ParamModifier = ParameterModifiers.Out; if (!newMethod.Parameters.Contains(p)) { newMethod.Parameters.Add(p); } else { this.beforeCallDeclarations.Add(new LocalVariableDeclaration(varDecl)); } } CreateReturnStatement(newMethod, possibleReturnValues); newMethod.Name = "NewMethod"; this.extractedMethod = newMethod; return(true); }
// public override bool Extract(MethodDeclaration md, Window window, List<INode> children) public bool Extract(ParametrizedNode parentNode, Window window, List <INode> children) { this.currentSelection = new MySelection(children.GetRange(window.Top, window.Size)); // this.start = new Location(this.currentSelection.StartPosition.Column + 1, this.currentSelection.StartPosition.Line + 1); // this.end = new Location(this.currentSelection.EndPosition.Column + 1, this.currentSelection.EndPosition.Line + 1); this.start = this.currentSelection.StartPosition; this.end = this.currentSelection.EndPosition; this.parentNode = parentNode; MethodDeclaration newMethod = new MethodDeclaration(); // Initialise new method newMethod.Body = GetBlock(currentSelection.Nodes); newMethod.Body.StartLocation = new Location(0, 0); List <VariableDeclaration> possibleReturnValues = new List <VariableDeclaration>(); List <VariableDeclaration> otherReturnValues = new List <VariableDeclaration>(); if (!CheckForJumpInstructions(newMethod, this.currentSelection)) { return(false); } newMethod.Modifier = parentNode.Modifier; newMethod.Modifier &= ~(Modifiers.Internal | Modifiers.Protected | Modifiers.Private | Modifiers.Public | Modifiers.Override); LookupTableVisitor ltv = new LookupTableVisitor(SupportedLanguage.CSharp); parentNode.AcceptVisitor(ltv, null); var variablesList = (from list in ltv.Variables.Values from item in list select new Variable(item)).Where(v => !(v.StartPos > end || v.EndPos < start) && HasReferencesInSelection(currentSelection, v)).Union(FromParameters(newMethod)).Select(va => ResolveVariable(va)); foreach (var variable in variablesList) { bool hasOccurrencesAfter = HasOccurrencesAfter(CSharpNameComparer, this.parentNode, end, variable.Name, variable.StartPos, variable.EndPos); bool isInitialized = (variable.Initializer != null) ? !variable.Initializer.IsNull : false; bool hasAssignment = HasAssignment(newMethod, variable); if (IsInSel(variable.StartPos, this.currentSelection) && hasOccurrencesAfter) { possibleReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type)); otherReturnValues.Add(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type)); } if (!(IsInSel(variable.StartPos, this.currentSelection) || IsInSel(variable.EndPos, this.currentSelection))) { ParameterDeclarationExpression newParam = null; if ((hasOccurrencesAfter && isInitialized) || variable.WasRefParam) { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.Ref); } else { if ((hasOccurrencesAfter && hasAssignment) || variable.WasOutParam) { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.Out); } else { if (!hasOccurrencesAfter) { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.None); } else { if (!hasOccurrencesAfter && !isInitialized) { newMethod.Body.Children.Insert(0, new LocalVariableDeclaration(new VariableDeclaration(variable.Name, variable.Initializer, variable.Type))); } else { newParam = new ParameterDeclarationExpression(variable.Type, variable.Name, ParameterModifiers.In); } } } } if (newParam != null) { newMethod.Parameters.Add(newParam); } } } List <VariableDeclaration> paramsAsVarDecls = new List <VariableDeclaration>(); this.beforeCallDeclarations = new List <LocalVariableDeclaration>(); for (int i = 0; i < otherReturnValues.Count - 1; i++) { VariableDeclaration varDecl = otherReturnValues[i]; paramsAsVarDecls.Add(varDecl); ParameterDeclarationExpression p = new ParameterDeclarationExpression(varDecl.TypeReference, varDecl.Name); p.ParamModifier = ParameterModifiers.Out; if (!newMethod.Parameters.Contains(p)) { newMethod.Parameters.Add(p); } else { this.beforeCallDeclarations.Add(new LocalVariableDeclaration(varDecl)); } } CreateReturnStatement(newMethod, possibleReturnValues); newMethod.Name = "NewMethod"; this.extractedMethod = newMethod; return(true); }
protected override IEnumerable <IBaseMember> GetValidMembers() { if (Options == null || Options.EnclosingType == null || Options.EnclosingMember == null || Options.Document == null) { yield break; } var editor = Options.Document.Editor; if (editor == null) { yield break; } INRefactoryASTProvider provider = Options.GetASTProvider(); if (provider == null) { yield break; } // add local variables LookupTableVisitor visitor = new LookupTableVisitor(ICSharpCode.NRefactory.SupportedLanguage.CSharp); Location location = new Location(editor.Caret.Line, editor.Caret.Column); var result = provider.ParseFile(editor.Text); result.AcceptVisitor(visitor, null); foreach (var pair in visitor.Variables) { foreach (LocalLookupVariable varDescr in pair.Value) { if (varDescr.StartPos <= location && location <= varDescr.EndPos) { yield return(new LocalVariable(Options.EnclosingMember, varDescr.Name, varDescr.TypeRef.ConvertToReturnType(), DomRegion.Empty)); } } } // add parameters if (Options.EnclosingMember.CanHaveParameters) { foreach (IParameter param in Options.EnclosingMember.Parameters) { yield return(param); } } // add type members foreach (IField field in Options.EnclosingType.Fields) { if (field.IsSpecialName) { continue; } yield return(field); } foreach (IProperty property in Options.EnclosingType.Properties) { if (property.IsSpecialName) { continue; } if (property.HasGet) { yield return(property); } } }
public ResolveResult Resolve(IParserContext parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent) { Console.WriteLine("Start Resolving"); if (expression == null) { return(null); } expression = expression.TrimStart(null); if (expression == "") { return(null); } if (expression.StartsWith("using ")) { // expression[expression.Length - 1] != '.' // the period that causes this Resove() is not part of the expression if (expression[expression.Length - 1] == '.') { return(null); } int i; for (i = expression.Length - 1; i >= 0; --i) { if (!(Char.IsLetterOrDigit(expression[i]) || expression[i] == '_' || expression[i] == '.')) { break; } } // no Identifier before the period if (i == expression.Length - 1) { return(null); } string t = expression.Substring(i + 1); // Console.WriteLine("in Using Statement"); string[] namespaces = parserService.GetNamespaceList(t); if (namespaces == null || namespaces.Length <= 0) { return(null); } return(new ResolveResult(namespaces)); } Console.WriteLine("Not in Using"); this.caretLine = caretLineNumber; this.caretColumn = caretColumn; this.parserService = parserService; IParseInformation parseInfo = parserService.GetParseInformation(fileName); JRefactory.Parser.AST.CompilationUnit fileCompilationUnit = parseInfo.MostRecentCompilationUnit.Tag as JRefactory.Parser.AST.CompilationUnit; if (fileCompilationUnit == null) { // JRefactory.Parser.Parser fileParser = new JRefactory.Parser.Parser(); // fileParser.Parse(new Lexer(new StringReader(fileContent))); Console.WriteLine("!Warning: no parseinformation!"); return(null); } /* * //// try to find last expression in original string, it could be like " if (act!=null) act" * //// in this case only "act" should be parsed as expression * !!is so!! don't change things that work * Expression expr=null; // tentative expression * Lexer l=null; * JRefactory.Parser.Parser p = new JRefactory.Parser.Parser(); * while (expression.Length > 0) { * l = new Lexer(new StringReader(expression)); * expr = p.ParseExpression(l); * if (l.LookAhead.val != "" && expression.LastIndexOf(l.LookAhead.val) >= 0) { * if (expression.Substring(expression.LastIndexOf(l.LookAhead.val) + l.LookAhead.val.Length).Length > 0) * expression=expression.Substring(expression.LastIndexOf(l.LookAhead.val) + l.LookAhead.val.Length).Trim(); * else { * expression=l.LookAhead.val.Trim(); * l=new Lexer(new StringReader(expression)); * expr=p.ParseExpression(l); * break; * } * } else { * if (l.Token.val!="" || expr!=null) break; * } * } * //// here last subexpression should be fixed in expr * if it should be changed in expressionfinder don't fix it here */ JRefactory.Parser.Parser p = new JRefactory.Parser.Parser(); Lexer l = new Lexer(new StringReader(expression)); Expression expr = p.ParseExpression(l); if (expr == null) { return(null); } lookupTableVisitor = new LookupTableVisitor(); lookupTableVisitor.Visit(fileCompilationUnit, null); TypeVisitor typeVisitor = new TypeVisitor(this); JavaVisitor cSharpVisitor = new JavaVisitor(); cu = (ICompilationUnit)cSharpVisitor.Visit(fileCompilationUnit, null); if (cu != null) { callingClass = GetInnermostClass(); //Console.WriteLine("CallingClass is " + callingClass == null ? "null" : callingClass.Name); } //Console.WriteLine("expression = " + expr.ToString()); IReturnType type = expr.AcceptVisitor(typeVisitor, null) as IReturnType; //Console.WriteLine("type visited"); if (type == null || type.PointerNestingLevel != 0) { // Console.WriteLine("Type == null || type.PointerNestingLevel != 0"); if (type != null) { //Console.WriteLine("PointerNestingLevel is " + type.PointerNestingLevel); } else { //Console.WriteLine("Type == null"); } //// when type is null might be file needs to be reparsed - some vars were lost fileCompilationUnit = parserService.ParseFile(fileName, fileContent).MostRecentCompilationUnit.Tag as JRefactory.Parser.AST.CompilationUnit; lookupTableVisitor.Visit(fileCompilationUnit, null); cu = (ICompilationUnit)cSharpVisitor.Visit(fileCompilationUnit, null); if (cu != null) { callingClass = GetInnermostClass(); } type = expr.AcceptVisitor(typeVisitor, null) as IReturnType; if (type == null) { return(null); } } if (type.ArrayDimensions != null && type.ArrayDimensions.Length > 0) { type = new ReturnType("System.Array"); } Console.WriteLine("Here: Type is " + type.FullyQualifiedName); IClass returnClass = SearchType(type.FullyQualifiedName, cu); if (returnClass == null) { // Try if type is Namespace: string n = SearchNamespace(type.FullyQualifiedName, cu); if (n == null) { return(null); } ArrayList content = parserService.GetNamespaceContents(n); ArrayList classes = new ArrayList(); for (int i = 0; i < content.Count; ++i) { if (content[i] is IClass) { classes.Add((IClass)content[i]); } } string[] namespaces = parserService.GetNamespaceList(n); return(new ResolveResult(namespaces, classes)); } Console.WriteLine("Returning Result!"); return(new ResolveResult(returnClass, ListMembers(new ArrayList(), returnClass))); }
public LanguageItemCollection CtrlSpace(IParserContext parserService, int caretLine, int caretColumn, string fileName) { LanguageItemCollection result = new LanguageItemCollection(); this.parserService = parserService; IParseInformation parseInfo = parserService.GetParseInformation(fileName); JRefactory.Parser.AST.CompilationUnit fileCompilationUnit = parseInfo.MostRecentCompilationUnit.Tag as JRefactory.Parser.AST.CompilationUnit; if (fileCompilationUnit == null) { return null; } lookupTableVisitor = new LookupTableVisitor(); lookupTableVisitor.Visit(fileCompilationUnit, null); JavaVisitor cSharpVisitor = new JavaVisitor (); cu = (ICompilationUnit)cSharpVisitor.Visit(fileCompilationUnit, null); if (cu != null) { callingClass = GetInnermostClass(); // Console.WriteLine("CallingClass is " + callingClass == null ? "null" : callingClass.Name); } foreach (string name in lookupTableVisitor.variables.Keys) { ArrayList variables = (ArrayList)lookupTableVisitor.variables[name]; if (variables != null && variables.Count > 0) { foreach (LocalLookupVariable v in variables) { if (IsInside(new Point(caretColumn, caretLine), v.StartPos, v.EndPos)) { result.Add(v); break; } } } } if (callingClass != null) { result = ListMembers(result, callingClass); } string n = ""; result.AddRange(parserService.GetNamespaceContents(n)); foreach (IUsing u in cu.Usings) { if (u != null && (u.Region == null || u.Region.IsInside(caretLine, caretColumn))) { foreach (string name in u.Usings) { result.AddRange(parserService.GetNamespaceContents(name)); } foreach (string alias in u.Aliases.Keys) { result.Add(alias); } } } return result; }
public ResolveResult Resolve(IParserContext parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent) { Console.WriteLine("Start Resolving"); if (expression == null) { return null; } expression = expression.TrimStart(null); if (expression == "") { return null; } if (expression.StartsWith("using ")) { // expression[expression.Length - 1] != '.' // the period that causes this Resove() is not part of the expression if (expression[expression.Length - 1] == '.') { return null; } int i; for (i = expression.Length - 1; i >= 0; --i) { if (!(Char.IsLetterOrDigit(expression[i]) || expression[i] == '_' || expression[i] == '.')) { break; } } // no Identifier before the period if (i == expression.Length - 1) { return null; } string t = expression.Substring(i + 1); // Console.WriteLine("in Using Statement"); string[] namespaces = parserService.GetNamespaceList(t); if (namespaces == null || namespaces.Length <= 0) { return null; } return new ResolveResult(namespaces); } Console.WriteLine("Not in Using"); this.caretLine = caretLineNumber; this.caretColumn = caretColumn; this.parserService = parserService; IParseInformation parseInfo = parserService.GetParseInformation(fileName); JRefactory.Parser.AST.CompilationUnit fileCompilationUnit = parseInfo.MostRecentCompilationUnit.Tag as JRefactory.Parser.AST.CompilationUnit; if (fileCompilationUnit == null) { // JRefactory.Parser.Parser fileParser = new JRefactory.Parser.Parser(); // fileParser.Parse(new Lexer(new StringReader(fileContent))); Console.WriteLine("!Warning: no parseinformation!"); return null; } /* //// try to find last expression in original string, it could be like " if (act!=null) act" //// in this case only "act" should be parsed as expression !!is so!! don't change things that work Expression expr=null; // tentative expression Lexer l=null; JRefactory.Parser.Parser p = new JRefactory.Parser.Parser(); while (expression.Length > 0) { l = new Lexer(new StringReader(expression)); expr = p.ParseExpression(l); if (l.LookAhead.val != "" && expression.LastIndexOf(l.LookAhead.val) >= 0) { if (expression.Substring(expression.LastIndexOf(l.LookAhead.val) + l.LookAhead.val.Length).Length > 0) expression=expression.Substring(expression.LastIndexOf(l.LookAhead.val) + l.LookAhead.val.Length).Trim(); else { expression=l.LookAhead.val.Trim(); l=new Lexer(new StringReader(expression)); expr=p.ParseExpression(l); break; } } else { if (l.Token.val!="" || expr!=null) break; } } //// here last subexpression should be fixed in expr if it should be changed in expressionfinder don't fix it here */ JRefactory.Parser.Parser p = new JRefactory.Parser.Parser(); Lexer l = new Lexer(new StringReader(expression)); Expression expr = p.ParseExpression(l); if (expr == null) { return null; } lookupTableVisitor = new LookupTableVisitor(); lookupTableVisitor.Visit(fileCompilationUnit, null); TypeVisitor typeVisitor = new TypeVisitor(this); JavaVisitor cSharpVisitor = new JavaVisitor(); cu = (ICompilationUnit)cSharpVisitor.Visit(fileCompilationUnit, null); if (cu != null) { callingClass = GetInnermostClass(); //Console.WriteLine("CallingClass is " + callingClass == null ? "null" : callingClass.Name); } //Console.WriteLine("expression = " + expr.ToString()); IReturnType type = expr.AcceptVisitor(typeVisitor, null) as IReturnType; //Console.WriteLine("type visited"); if (type == null || type.PointerNestingLevel != 0) { // Console.WriteLine("Type == null || type.PointerNestingLevel != 0"); if (type != null) { //Console.WriteLine("PointerNestingLevel is " + type.PointerNestingLevel); } else { //Console.WriteLine("Type == null"); } //// when type is null might be file needs to be reparsed - some vars were lost fileCompilationUnit=parserService.ParseFile(fileName, fileContent).MostRecentCompilationUnit.Tag as JRefactory.Parser.AST.CompilationUnit; lookupTableVisitor.Visit(fileCompilationUnit,null); cu = (ICompilationUnit)cSharpVisitor.Visit(fileCompilationUnit, null); if (cu != null) { callingClass = GetInnermostClass(); } type=expr.AcceptVisitor(typeVisitor,null) as IReturnType; if (type==null) return null; } if (type.ArrayDimensions != null && type.ArrayDimensions.Length > 0) { type = new ReturnType("System.Array"); } Console.WriteLine("Here: Type is " + type.FullyQualifiedName); IClass returnClass = SearchType(type.FullyQualifiedName, cu); if (returnClass == null) { // Try if type is Namespace: string n = SearchNamespace(type.FullyQualifiedName, cu); if (n == null) { return null; } ArrayList content = parserService.GetNamespaceContents(n); ArrayList classes = new ArrayList(); for (int i = 0; i < content.Count; ++i) { if (content[i] is IClass) { classes.Add((IClass)content[i]); } } string[] namespaces = parserService.GetNamespaceList(n); return new ResolveResult(namespaces, classes); } Console.WriteLine("Returning Result!"); return new ResolveResult(returnClass, ListMembers(new ArrayList(), returnClass)); }