Skip to content

Commit

Permalink
[vscode] Set typescript.tsserver.maxTsServerMemory (#113959) (#114124)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <[email protected]>

Co-authored-by: Tyler Smalley <[email protected]>
  • Loading branch information
kibanamachine and Tyler Smalley authored Oct 6, 2021
1 parent 6aaebdb commit b86c1c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
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

0 comments on commit b86c1c4

Please sign in to comment.