Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/PowerShellEditorServices/Server/PsesLanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,17 @@ public async Task StartAsync()
JObject initializationOptions = initializeParams.InitializationOptions as JObject;
HostStartOptions hostStartOptions = new()
{
LoadProfiles = initializationOptions?.GetValue("EnableProfileLoading")?.Value<bool>() ?? 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<bool>() ?? true,
// TODO: Consider deprecating the setting which sets this and
// instead use WorkspacePath exclusively.
InitialWorkingDirectory = initializationOptions?.GetValue("InitialWorkingDirectory")?.Value<string>() ?? workspaceService.WorkspacePath
InitialWorkingDirectory = initializationOptions?.GetValue("initialWorkingDirectory")?.Value<string>() ?? workspaceService.WorkspacePath
};

_psesHost = languageServer.Services.GetService<PsesInternalHost>();
Expand Down
3 changes: 2 additions & 1 deletion test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down