Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set EnableProfileLoading default to true #1802

Merged
merged 1 commit into from
May 17, 2022
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
Set EnableProfileLoading default to true
So it can be turned off if needed, but otherwise has a sane default.

We need to turn it off during E2E testing for CI.
  • Loading branch information
andyleejordan committed May 17, 2022
commit c4202e7be111a10f6f3370ab2640fa1fc029959f
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