MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / clearCachedFiles

Method clearCachedFiles

src/helpViewer/packages.ts:109–121  ·  view source on GitHub ↗
(re?: string|RegExp)

Source from the content-addressed store, hash-verified

107
108 // Funciton to clear only the cached files regarding an individual package etc.
109 public async clearCachedFiles(re?: string|RegExp): Promise<void> {
110 let cache: CachedIndexFiles | undefined;
111 if(re){
112 const oldCache = this.state.get<CachedIndexFiles>('r.helpPanel.cachedIndexFiles', []);
113 cache = oldCache.filter(v => !(
114 (typeof re === 'string' && v.path === re)
115 || (typeof re !== 'string' && re.exec(v.path))
116 ));
117 } else{
118 cache = undefined;
119 }
120 await this.state.update('r.helpPanel.cachedIndexFiles', cache);
121 }
122
123 // Function to add/remove packages from favorites
124 public addFavorite(pkgName: string): string[] {

Callers 1

refreshMethod · 0.95

Calls 2

updateMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected