private static ICollection <ILexSymbol> Build(ILexFile file) { var ret = new LexCacheBuilder(); file.ProcessDescendants(ret); return(ret.GetSymbols()); }
public void Save(IProgressIndicator progress, bool enablePersistence) { if (!enablePersistence) { return; } Assertion.Assert(myPersistentCache != null, "myPersistentCache != null"); myPersistentCache.Save(progress, myPersistentIdIndex, (writer, file, data) => LexCacheBuilder.Write(data, writer)); myPersistentCache.Dispose(); myPersistentCache = null; }
public void SyncUpdate(bool underTransaction) { myShellLocks.AssertReadAccessAllowed(); if (myDirtyFiles.Count > 0) { foreach (IPsiSourceFile projectFile in new List <IPsiSourceFile>(myDirtyFiles)) { using (WriteLockCookie.Create()) { ICollection <ILexSymbol> ret = LexCacheBuilder.Build(projectFile); if (ret != null) { ((ICache)this).Merge(projectFile, ret.ToList()); } else { ((ICache)this).Merge(projectFile, null); } } } } }
public object Load(IProgressIndicator progress, bool enablePersistence) { if (!enablePersistence) { return(null); } Assertion.Assert(myPersistentCache == null, "myPersistentCache == null"); using (ReadLockCookie.Create()) { myPersistentCache = new LexPersistentCache <CacheData>(myShellLocks, VERSION, "LexCache", myPsiConfiguration); } var data = new Dictionary <IPsiSourceFile, CacheData>(); if (myPersistentCache.Load(progress, myPersistentIdIndex, (file, reader) => { using (ReadLockCookie.Create()) { return(LexCacheBuilder.Read(reader, file)); } }, (projectFile, psiSymbols) => { if (projectFile != null) { data[projectFile] = psiSymbols; } }) != LoadResult.OK) { return(data); } return(null); }
public object Build(IPsiSourceFile sourceFile, bool isStartup) { return(LexCacheBuilder.Build(sourceFile)); }