diff --git a/src/OmniSharp.Host/WorkspaceInitializer.cs b/src/OmniSharp.Host/WorkspaceInitializer.cs index b2c869cb46..273a213bdc 100644 --- a/src/OmniSharp.Host/WorkspaceInitializer.cs +++ b/src/OmniSharp.Host/WorkspaceInitializer.cs @@ -27,11 +27,22 @@ public static void Initialize(IServiceProvider serviceProvider, CompositionHost var projectEventForwarder = compositionHost.GetExport(); projectEventForwarder.Initialize(); - var projectSystems = compositionHost.GetExports(); workspace.EditorConfigEnabled = options.CurrentValue.FormattingOptions.EnableEditorConfigSupport; options.OnChange(x => workspace.EditorConfigEnabled = x.FormattingOptions.EnableEditorConfigSupport); + logger.LogDebug("Starting with OmniSharp options: {options}", options.CurrentValue); + ProvideWorkspaceOptions(compositionHost, workspace, options, logger, omnisharpEnvironment); + + // when configuration options change + // run workspace options providers automatically + options.OnChange(o => + { + logger.LogDebug("OmniSharp options changed: {options}", options.CurrentValue); + ProvideWorkspaceOptions(compositionHost, workspace, options, logger, omnisharpEnvironment); + }); + + var projectSystems = compositionHost.GetExports(); foreach (var projectSystem in projectSystems) { try @@ -55,20 +66,9 @@ public static void Initialize(IServiceProvider serviceProvider, CompositionHost } } - logger.LogDebug("Starting with OmniSharp options: {options}", options.CurrentValue); - ProvideWorkspaceOptions(compositionHost, workspace, options, logger, omnisharpEnvironment); - // Mark the workspace as initialized workspace.Initialized = true; - // when configuration options change - // run workspace options providers automatically - options.OnChange(o => - { - logger.LogDebug("OmniSharp options changed: {options}", options.CurrentValue); - ProvideWorkspaceOptions(compositionHost, workspace, options, logger, omnisharpEnvironment); - }); - logger.LogInformation("Configuration finished."); }