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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

export interface ManagedConfigKey {
key: string;
value: string | Record<string, any> | boolean;
value: string | Record<string, any> | boolean | number;
}

/**
Expand Down Expand Up @@ -46,4 +46,8 @@ export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [
key: 'typescript.enablePromptUseWorkspaceTsdk',
value: true,
},
{
key: 'typescript.tsserver.maxTsServerMemory',
value: 4096,
},
];
14 changes: 7 additions & 7 deletions packages/kbn-dev-utils/src/vscode_config/update_vscode_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ const createObjectPropOfManagedValues = (key: string, value: Record<string, any>
const addManagedProp = (
ast: t.ObjectExpression,
key: string,
value: string | Record<string, any> | boolean
value: string | Record<string, any> | boolean | number
) => {
ast.properties.push(
typeof value === 'string' || typeof value === 'boolean'
? createManagedProp(key, value)
: createObjectPropOfManagedValues(key, value)
);
if (['number', 'string', 'boolean'].includes(typeof value)) {
ast.properties.push(createManagedProp(key, value));
} else {
ast.properties.push(createObjectPropOfManagedValues(key, value as Record<string, any>));
}
};

/**
Expand All @@ -89,7 +89,7 @@ const addManagedProp = (
const replaceManagedProp = (
ast: t.ObjectExpression,
existing: BasicObjectProp,
value: string | Record<string, any> | boolean
value: string | Record<string, any> | boolean | number
) => {
remove(ast.properties, existing);
addManagedProp(ast, existing.key.value, value);
Expand Down