public void loadCompilationUnit(string filePath, List <ISpecial> specials, CompilationUnit compilationUnit) { //store specials FileToSpecials.add(filePath, specials); // map all INodes FileToINodes.add(filePath, new GetAllINodes(compilationUnit)); FileToCompilationUnit.add(filePath, compilationUnit); //Map AsT to DOM (System.DOM classes) MapAstToDom.loadCompilationUnit(compilationUnit); //Map AST to NRefactory (ICompilationUnit, IClass, IMethod) MapAstToNRefactory.loadCompilationUnit(compilationUnit); // update variable for CodeComplete O2AstResolver.setCurrentCompilationUnit(compilationUnit); var iCompilationUnit = MapAstToNRefactory.CompilationUnitToICompilationUnit[compilationUnit]; O2AstResolver.myProjectContent.UpdateCompilationUnit(null, iCompilationUnit, ""); }
public void Dispose() { try { if (O2AstResolver.notNull()) { O2AstResolver.myProjectContent.Classes.Clear(); O2AstResolver.myProjectContent.ClassLists.Clear(); //O2AstResolver.myProjectContent.NamespaceNames.Clear(); O2AstResolver.myProjectContent.ReferencedContents.Clear(); O2AstResolver.pcRegistry.Dispose(); O2AstResolver.myProjectContent.Dispose(); GC.Collect(10, GCCollectionMode.Forced); } O2AstResolver = null; //"added reference to MsCorLib.dll and System.dll".info(); MapAstToDom = null; MapAstToNRefactory = null; if (FileToINodes.notNull()) { FileToINodes.Clear(); } FileToINodes = null; if (FileToCompilationUnit.notNull()) { FileToCompilationUnit.Clear(); } FileToCompilationUnit = null; if (FileToSpecials.notNull()) { FileToSpecials.Clear(); } FileToSpecials = null; } catch (Exception ex) { ex.log("in O2MappedAstData.Dispose()"); } }