@@ -148,7 +148,7 @@ export abstract class WatchedFiles<T> implements vscode.Disposable {
148
148
this . disposables . push (
149
149
vscode . workspace . onDidChangeTextDocument ( ( event : vscode . TextDocumentChangeEvent ) => {
150
150
if ( isUntitledScheme ( event . document . uri ) ) {
151
- this . addItemToRegistry ( event . document . uri , true , event . document . getText ( ) )
151
+ this . addItem ( event . document . uri , true , event . document . getText ( ) )
152
152
}
153
153
} ) ,
154
154
vscode . workspace . onDidCloseTextDocument ( ( event : vscode . TextDocument ) => {
@@ -175,7 +175,7 @@ export abstract class WatchedFiles<T> implements vscode.Disposable {
175
175
* Adds an item to registry. Wipes any existing item in its place with new copy of the data
176
176
* @param uri vscode.Uri containing the item to load in
177
177
*/
178
- public async addItemToRegistry ( uri : vscode . Uri , quiet ?: boolean , contents ?: string ) : Promise < void > {
178
+ public async addItem ( uri : vscode . Uri , quiet ?: boolean , contents ?: string ) : Promise < void > {
179
179
const excluded = this . excludedFilePatterns . find ( pattern => uri . fsPath . match ( pattern ) )
180
180
if ( excluded ) {
181
181
getLogger ( ) . verbose ( `${ this . name } : excluding path (matches "${ excluded } "): ${ uri . fsPath } ` )
@@ -220,9 +220,9 @@ export abstract class WatchedFiles<T> implements vscode.Disposable {
220
220
}
221
221
222
222
/**
223
- * Returns the registry's data as an array of paths to type T objects
223
+ * Gets all registry items as an array of paths to type `T` objects.
224
224
*/
225
- public get registeredItems ( ) : WatchedItem < T > [ ] {
225
+ public get items ( ) : WatchedItem < T > [ ] {
226
226
const arr : WatchedItem < T > [ ] = [ ]
227
227
228
228
for ( const itemPath of this . registryData . keys ( ) ) {
@@ -273,7 +273,7 @@ export abstract class WatchedFiles<T> implements vscode.Disposable {
273
273
try {
274
274
const found = await vscode . workspace . findFiles ( glob , exclude )
275
275
for ( const item of found ) {
276
- await this . addItemToRegistry ( item , true )
276
+ await this . addItem ( item , true )
277
277
}
278
278
} catch ( e ) {
279
279
const err = e as Error
@@ -300,11 +300,11 @@ export abstract class WatchedFiles<T> implements vscode.Disposable {
300
300
watcher ,
301
301
watcher . onDidChange ( async uri => {
302
302
getLogger ( ) . verbose ( `${ this . name } : detected change: ${ uri . fsPath } ` )
303
- await this . addItemToRegistry ( uri )
303
+ await this . addItem ( uri )
304
304
} ) ,
305
305
watcher . onDidCreate ( async uri => {
306
306
getLogger ( ) . verbose ( `${ this . name } : detected new file: ${ uri . fsPath } ` )
307
- await this . addItemToRegistry ( uri )
307
+ await this . addItem ( uri )
308
308
} ) ,
309
309
watcher . onDidDelete ( async uri => {
310
310
getLogger ( ) . verbose ( `${ this . name } : detected delete: ${ uri . fsPath } ` )
0 commit comments