Skip to content

Pass EnableProfileLoading and InitialWorkingDirectory as initializationOptions #3986

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

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
5 changes: 5 additions & 0 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ export class SessionManager implements Middleware {
configurationSection: [ utils.PowerShellLanguageId, "files", "search" ],
// fileEvents: vscode.workspace.createFileSystemWatcher('**/.eslintrc')
},
// NOTE: Some settings are only applicable on startup, so we send them during initialization.
initializationOptions: {
EnableProfileLoading: this.sessionSettings.enableProfileLoading,
InitialWorkingDirectory: this.sessionSettings.cwd,
},
errorHandler: {
// Override the default error handler to prevent it from
// closing the LanguageClient incorrectly when the socket
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export function load(): ISettings {
// is the reason terminals on macOS typically run login shells by default which set up
// the environment. See http://unix.stackexchange.com/a/119675/115410"
configuration.get<IStartAsLoginShellSettings>("startAsLoginShell", defaultStartAsLoginShellSettings),
cwd:
cwd: // TODO: Should we resolve this path and/or default to a workspace folder?
configuration.get<string>("cwd", null),
};
}
Expand Down