diff --git a/src/PowerShellEditorServices/Server/PsesLanguageServer.cs b/src/PowerShellEditorServices/Server/PsesLanguageServer.cs index 877f8377a..1f740cec6 100644 --- a/src/PowerShellEditorServices/Server/PsesLanguageServer.cs +++ b/src/PowerShellEditorServices/Server/PsesLanguageServer.cs @@ -141,10 +141,17 @@ public async Task StartAsync() JObject initializationOptions = initializeParams.InitializationOptions as JObject; HostStartOptions hostStartOptions = new() { - LoadProfiles = initializationOptions?.GetValue("EnableProfileLoading")?.Value() ?? false, + // TODO: We need to synchronize our "default" settings as specified + // in the VS Code extension's package.json with the actual default + // values in this project. For now, this is going to be the most + // annoying setting, so we're defaulting this to true. + // + // NOTE: The keys start with a lowercase because OmniSharp's client + // (used for testing) forces it to be that way. + LoadProfiles = initializationOptions?.GetValue("enableProfileLoading")?.Value() ?? true, // TODO: Consider deprecating the setting which sets this and // instead use WorkspacePath exclusively. - InitialWorkingDirectory = initializationOptions?.GetValue("InitialWorkingDirectory")?.Value() ?? workspaceService.WorkspacePath + InitialWorkingDirectory = initializationOptions?.GetValue("initialWorkingDirectory")?.Value() ?? workspaceService.WorkspacePath }; _psesHost = languageServer.Services.GetService(); diff --git a/test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs b/test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs index 4d9db8c82..12e29ee07 100644 --- a/test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs +++ b/test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs @@ -56,7 +56,8 @@ public async Task InitializeAsync() options .WithInput(_psesProcess.OutputStream) .WithOutput(_psesProcess.InputStream) - .WithRootUri(DocumentUri.FromFileSystemPath(testdir.FullName)) + .WithWorkspaceFolder(DocumentUri.FromFileSystemPath(testdir.FullName), "testdir") + .WithInitializationOptions(new { EnableProfileLoading = false }) .OnPublishDiagnostics(diagnosticParams => Diagnostics.AddRange(diagnosticParams.Diagnostics.Where(d => d != null))) .OnLogMessage(logMessageParams => Output?.WriteLine($"{logMessageParams.Type}: {logMessageParams.Message}")) .OnTelemetryEvent(telemetryEventParams => TelemetryEvents.Add(