fix(config): set a default memory limit (#235)
parent
9558c8aaca
commit
a3e2822904
|
@ -94,8 +94,8 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"php.memoryLimit": {
|
"php.memoryLimit": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "-1",
|
"default": "4G",
|
||||||
"description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM(default).",
|
"description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM (default is 4G).",
|
||||||
"pattern": "^\\d+[KMG]?$"
|
"pattern": "^\\d+[KMG]?$"
|
||||||
},
|
},
|
||||||
"php.executablePath": {
|
"php.executablePath": {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
||||||
const conf = vscode.workspace.getConfiguration('php');
|
const conf = vscode.workspace.getConfiguration('php');
|
||||||
const executablePath = conf.get<string>('executablePath') || 'php';
|
const executablePath = conf.get<string>('executablePath') || 'php';
|
||||||
|
|
||||||
const memoryLimit = conf.get<string>('memoryLimit') || '-1';
|
const memoryLimit = conf.get<string>('memoryLimit') || '4G';
|
||||||
|
|
||||||
if (memoryLimit !== '-1' && !/^\d+[KMG]?$/.exec(memoryLimit)) {
|
if (memoryLimit !== '-1' && !/^\d+[KMG]?$/.exec(memoryLimit)) {
|
||||||
const selected = await vscode.window.showErrorMessage(
|
const selected = await vscode.window.showErrorMessage(
|
||||||
|
|
Loading…
Reference in New Issue