MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / getCachedIndexFile

Method getCachedIndexFile

src/helpViewer/packages.ts:138–146  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

136
137 // return the index file if cached, else undefined
138 private getCachedIndexFile(path: string): IndexEntry[] | undefined {
139 const cache = this.state.get<CachedIndexFiles>('r.helpPanel.cachedIndexFiles', []);
140 const ind = cache.findIndex(v => v.path === path);
141 if(ind < 0){
142 return undefined;
143 } else{
144 return cache[ind].items;
145 }
146 }
147
148 // Save a new file to the cache (or update existing entry)
149 private async updateCachedIndexFile(path: string, items: IndexEntry[] | undefined): Promise<void>{

Callers 2

getPackagesMethod · 0.95
getParsedIndexFileMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected