Skip to content

Commit

Permalink
Implemented further review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisalmen committed Sep 25, 2024
1 parent 1ba4a1d commit 51476b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/wrapper/src/vscode/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ export const configureServices = async (config: VscodeServicesConfig): Promise<I

// set the log-level via the development settings
const devLogLevel = serviceConfig.workspaceConfig.developmentOptions?.logLevel;
if (serviceConfig.workspaceConfig.developmentOptions?.logLevel === undefined) {
if (devLogLevel === undefined) {

// this needs to be done so complicated, because developmentOptions is read-only
const devOptions = (serviceConfig.workspaceConfig.developmentOptions as unknown as Record<string, unknown> | undefined) ?? {};
const devOptions: Record<string, unknown> = {
...serviceConfig.workspaceConfig.developmentOptions
};
devOptions.logLevel = config.logLevel;
(serviceConfig.workspaceConfig.developmentOptions as Record<string, unknown>) = Object.assign(serviceConfig.workspaceConfig.developmentOptions ?? {}, devOptions);
(serviceConfig.workspaceConfig.developmentOptions as Record<string, unknown>) = Object.assign({}, devOptions);
} else if (devLogLevel !== config.logLevel) {

throw new Error(`You have configured mismatching logLevels: ${config.logLevel} (wrapperConfig) ${devLogLevel} (workspaceConfig.developmentOptions)`);
Expand Down

0 comments on commit 51476b8

Please sign in to comment.