private static ICollection <INTriplesSymbol> Build(INTriplesFile file) { var ret = new NTriplesCacheBuilder(file); file.ProcessDescendants(ret); return(ret.GetSymbols()); }
public void Save(IProgressIndicator progress, bool enablePersistence) { if (!enablePersistence) { return; } Assertion.Assert(this.myPersistentCache != null, "myPersistentCache != null"); this.myPersistentCache.Save( progress, this.myPersistentIdIndex, (writer, file, data) => NTriplesCacheBuilder.Write(data, writer)); this.myPersistentCache.Dispose(); this.myPersistentCache = null; }
public void SyncUpdate(bool underTransaction) { this.myShellLocks.AssertReadAccessAllowed(); if (this.myDirtyFiles.Count > 0) { foreach (IPsiSourceFile projectFile in new List <IPsiSourceFile>(this.myDirtyFiles)) { using (WriteLockCookie.Create()) { ICollection <INTriplesSymbol> ret = NTriplesCacheBuilder.Build(projectFile); ((ICache)this).Merge( projectFile, ret != null ? ret.ToList() : null); } } } }
public object Load(IProgressIndicator progress, bool enablePersistence) { if (!enablePersistence) { return(null); } Assertion.Assert(this.myPersistentCache == null, "myPersistentCache == null"); using (ReadLockCookie.Create()) { this.myPersistentCache = new NTriplesPersistentCache <NTriplesFileCache>( this.myShellLocks, Version, "NTriplesCache", this.myPsiConfiguration); } var data = new Dictionary <IPsiSourceFile, NTriplesFileCache>(); if (this.myPersistentCache.Load( progress, this.myPersistentIdIndex, (file, reader) => { using (ReadLockCookie.Create()) { return(NTriplesCacheBuilder.Read(reader, file)); } }, (projectFile, psiSymbols) => { if (projectFile != null) { data[projectFile] = psiSymbols; } }) != LoadResult.OK) { // clear all... return(null); } return(data); }
public object Build(IPsiSourceFile sourceFile, bool isStartup) { return(NTriplesCacheBuilder.Build(sourceFile)); }