Skip to content

Commit b25e649

Browse files
committed
Fix code completion not working in for..of
Code completion inside "for..of" would not work until the project was compiled. The variable defined by the for..of statement would produce no member completion results when the dot character was pressed inside the for..of loop. Now when the project is created the compiler settings are updated in the shim host.
1 parent fe7e7e7 commit b25e649

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/TypeScriptBinding/Hosting/TypeScriptContext.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,10 @@ public void AddFiles(IEnumerable<TypeScriptFile> files)
178178
AddFile(file.FileName, file.Text);
179179
}
180180
}
181+
182+
public void UpdateOptions(ITypeScriptOptions options)
183+
{
184+
host.UpdateCompilerSettings(options);
185+
}
181186
}
182187
}

src/TypeScriptBinding/Hosting/TypeScriptContextProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public TypeScriptContext CreateProjectContext(TypeScriptProject project)
103103
}
104104

105105
context.RunInitialisationScript();
106+
context.UpdateOptions(project);
106107
context.GetCompletionItemsForTheFirstTime();
107108

108109
return context;

0 commit comments

Comments
 (0)