void RunLookupTableVisitor(string fileContent) { lookupTableVisitor = new LookupTableVisitor(language); if (callingMember != null) { CompilationUnit cu = ParseCurrentMemberAsCompilationUnit(fileContent); if (cu != null) { lookupTableVisitor.VisitCompilationUnit(cu, null); } } }
public ArrayList CtrlSpace(int caretLine, int caretColumn, string fileName, string fileContent, ExpressionContext context) { ArrayList result = new ArrayList(); if (language == NR.SupportedLanguage.VBNet) { foreach (KeyValuePair <string, string> pair in TypeReference.PrimitiveTypesVB) { if ("System." + pair.Key != pair.Value) { IClass c = GetPrimitiveClass(pair.Value, pair.Key); if (c != null) { result.Add(c); } } } result.Add("Global"); result.Add("New"); } else { foreach (KeyValuePair <string, string> pair in TypeReference.PrimitiveTypesCSharp) { IClass c = GetPrimitiveClass(pair.Value, pair.Key); if (c != null) { result.Add(c); } } } ParseInformation parseInfo = HostCallback.GetParseInformation(fileName); if (parseInfo == null) { return(null); } this.caretLine = caretLine; this.caretColumn = caretColumn; lookupTableVisitor = new LookupTableVisitor(language); cu = parseInfo.MostRecentCompilationUnit; if (cu != null) { callingClass = cu.GetInnermostClass(caretLine, caretColumn); } callingMember = GetCurrentMember(); if (callingMember != null) { CompilationUnit parsedCu = ParseCurrentMemberAsCompilationUnit(fileContent); if (parsedCu != null) { lookupTableVisitor.VisitCompilationUnit(parsedCu, null); } } CtrlSpaceResolveHelper.AddContentsFromCalling(result, callingClass, callingMember); foreach (KeyValuePair <string, List <LocalLookupVariable> > pair in lookupTableVisitor.Variables) { if (pair.Value != null && pair.Value.Count > 0) { foreach (LocalLookupVariable v in pair.Value) { if (IsInside(new NR.Location(caretColumn, caretLine), v.StartPos, v.EndPos)) { // convert to a field for display result.Add(CreateLocalVariableField(v, pair.Key)); break; } } } } if (callingMember is IProperty) { IProperty property = (IProperty)callingMember; if (property.SetterRegion.IsInside(caretLine, caretColumn)) { result.Add(new DefaultField.ParameterField(property.ReturnType, "value", property.Region, callingClass)); } } CtrlSpaceResolveHelper.AddImportedNamespaceContents(result, cu, callingClass); return(result); }