mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[vscode] Set typescript.tsserver.maxTsServerMemory (#113959)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
parent
e16495792f
commit
b59e3ff460
2 changed files with 12 additions and 8 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
export interface ManagedConfigKey {
|
||||
key: string;
|
||||
value: string | Record<string, any> | boolean;
|
||||
value: string | Record<string, any> | boolean | number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,4 +46,8 @@ export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [
|
|||
key: 'typescript.enablePromptUseWorkspaceTsdk',
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: 'typescript.tsserver.maxTsServerMemory',
|
||||
value: 4096,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -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>));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue