[vscode] Set typescript.tsserver.maxTsServerMemory (#113959)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
parent
e16495792f
commit
b59e3ff460
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
export interface ManagedConfigKey {
|
export interface ManagedConfigKey {
|
||||||
key: string;
|
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',
|
key: 'typescript.enablePromptUseWorkspaceTsdk',
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'typescript.tsserver.maxTsServerMemory',
|
||||||
|
value: 4096,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -69,13 +69,13 @@ const createObjectPropOfManagedValues = (key: string, value: Record<string, any>
|
||||||
const addManagedProp = (
|
const addManagedProp = (
|
||||||
ast: t.ObjectExpression,
|
ast: t.ObjectExpression,
|
||||||
key: string,
|
key: string,
|
||||||
value: string | Record<string, any> | boolean
|
value: string | Record<string, any> | boolean | number
|
||||||
) => {
|
) => {
|
||||||
ast.properties.push(
|
if (['number', 'string', 'boolean'].includes(typeof value)) {
|
||||||
typeof value === 'string' || typeof value === 'boolean'
|
ast.properties.push(createManagedProp(key, value));
|
||||||
? createManagedProp(key, value)
|
} else {
|
||||||
: createObjectPropOfManagedValues(key, value)
|
ast.properties.push(createObjectPropOfManagedValues(key, value as Record<string, any>));
|
||||||
);
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,7 +89,7 @@ const addManagedProp = (
|
||||||
const replaceManagedProp = (
|
const replaceManagedProp = (
|
||||||
ast: t.ObjectExpression,
|
ast: t.ObjectExpression,
|
||||||
existing: BasicObjectProp,
|
existing: BasicObjectProp,
|
||||||
value: string | Record<string, any> | boolean
|
value: string | Record<string, any> | boolean | number
|
||||||
) => {
|
) => {
|
||||||
remove(ast.properties, existing);
|
remove(ast.properties, existing);
|
||||||
addManagedProp(ast, existing.key.value, value);
|
addManagedProp(ast, existing.key.value, value);
|
||||||
|
|
Loading…
Reference in a new issue