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

Method updateCachedIndexFile

src/helpViewer/packages.ts:149–161  ·  view source on GitHub ↗
(path: string, items: IndexEntry[] | undefined)

Source from the content-addressed store, hash-verified

147
148 // Save a new file to the cache (or update existing entry)
149 private async updateCachedIndexFile(path: string, items: IndexEntry[] | undefined): Promise<void>{
150 const cache = this.state.get<CachedIndexFiles>('r.helpPanel.cachedIndexFiles', []);
151 const ind = cache.findIndex(v => v.path === path);
152 if(ind < 0){
153 cache.push({
154 path: path,
155 items: items
156 });
157 } else{
158 cache[ind].items = items;
159 }
160 await this.state.update('r.helpPanel.cachedIndexFiles', cache);
161 }
162
163 // Private functions used to sync favoriteNames with global state / workspace state
164 // Is used frequently when list of favorites is shared globally to sync between sessions

Callers 2

getPackagesMethod · 0.95
getParsedIndexFileMethod · 0.95

Calls 2

updateMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected