Second pass converting for index based looping to for-of loops

More manual conversion of index based for loops to for-of loops
This commit is contained in:
Matt Bierner
2019-01-03 20:19:49 -08:00
parent 137dbe92bb
commit c109d319fe
59 changed files with 174 additions and 200 deletions

View File

@@ -195,9 +195,9 @@ function escapePath(p: string) {
}
function resolveWorkspaceRoot(activeDoc: TextDocument, workspaceFolders: WorkspaceFolder[]): string | undefined {
for (let i = 0; i < workspaceFolders.length; i++) {
if (startsWith(activeDoc.uri, workspaceFolders[i].uri)) {
return path.resolve(URI.parse(workspaceFolders[i].uri).fsPath);
for (const folder of workspaceFolders) {
if (startsWith(activeDoc.uri, folder.uri)) {
return path.resolve(URI.parse(folder.uri).fsPath);
}
}
return undefined;