(filePaths: string[])
| 48 | |
| 49 | // Sets the list of tracked files that make up the program. |
| 50 | setTrackedFiles(filePaths: string[]): FileDiagnostics[] { |
| 51 | if (this._sourceFileList.length > 0) { |
| 52 | // We need to determine which files to remove from the existing file list. |
| 53 | let newFileMap: { [path: string]: string } = {}; |
| 54 | filePaths.forEach(path => { |
| 55 | newFileMap[path] = path; |
| 56 | }); |
| 57 | |
| 58 | // Files that are not in the tracked file list are |
| 59 | // marked as no longer tracked. |
| 60 | this._sourceFileList.forEach(oldFile => { |
| 61 | let filePath = oldFile.sourceFile.getFilePath(); |
| 62 | if (newFileMap[filePath] === undefined) { |
| 63 | oldFile.isTracked = false; |
| 64 | } |
| 65 | }); |
| 66 | } |
| 67 | |
| 68 | // Add the new files. Only the new items will be added. |
| 69 | this.addTrackedFiles(filePaths); |
| 70 | |
| 71 | return this._removeUnneededFiles(); |
| 72 | } |
| 73 | |
| 74 | getFileCount() { |
| 75 | return this._sourceFileList.length; |
no test coverage detected