Skip to content

Commit 55327f0

Browse files
author
Denis Peshkov
authored
Merge pull request #21 from denis-peshkov/bugfix/20-fix-background-load
#20 just fix
2 parents 2240ce9 + 392e0d6 commit 55327f0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/TypeScriptDefinitionGenerator/DtsPackage.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace TypeScriptDefinitionGenerator
1515
[ProvideMenuResource("Menus.ctmenu", 1)]
1616
[ProvideLanguageEditorOptionPage(typeof(OptionsDialogPage), "TypeScript", null, "Generate d.ts", null, new[] { "d.ts" })]
1717
[ProvideCodeGenerator(typeof(DtsGenerator), DtsGenerator.Name, DtsGenerator.Description, true)]
18-
[ProvideAutoLoad(PackageGuids.UIContextRuleString)]
18+
[ProvideAutoLoad(PackageGuids.UIContextRuleString, PackageAutoLoadFlags.BackgroundLoad)]
1919
[ProvideUIContextRule(PackageGuids.UIContextRuleString,
2020
name: "Auto load",
2121
expression: "cs | vb",
@@ -40,6 +40,8 @@ public static void EnsurePackageLoad()
4040

4141
protected override async Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
4242
{
43+
await JoinableTaskFactory.SwitchToMainThreadAsync();
44+
4345
Options = (OptionsDialogPage)GetDialogPage(typeof(OptionsDialogPage));
4446

4547
await ToggleCustomTool.InitializeAsync(this);

0 commit comments

Comments
 (0)