(path: string, items: IndexEntry[] | undefined)
| 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 |
no test coverage detected