simplify expression
parent
e49707fd1b
commit
5656246e5d
|
@ -62,7 +62,7 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "-1",
|
"default": "-1",
|
||||||
"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).",
|
||||||
"pattern": "^\\d+(?:K|M|G|)$"
|
"pattern": "^\\d+[KMG]?$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
||||||
|
|
||||||
const memoryLimit = conf.get<string>('memoryLimit') || '-1';
|
const memoryLimit = conf.get<string>('memoryLimit') || '-1';
|
||||||
|
|
||||||
if (memoryLimit !== '-1' && !/^\d+(?:K|M|G|)$/.exec(memoryLimit)) {
|
if (memoryLimit !== '-1' && !/^\d+[KMG]?$/.exec(memoryLimit)) {
|
||||||
const selected = await vscode.window.showErrorMessage(
|
const selected = await vscode.window.showErrorMessage(
|
||||||
'The memory limit you\'d provided is not numeric, nor "-1" nor valid php shorthand notation!',
|
'The memory limit you\'d provided is not numeric, nor "-1" nor valid php shorthand notation!',
|
||||||
'Open settings'
|
'Open settings'
|
||||||
|
|
Loading…
Reference in New Issue