simplify expression

pull/102/head
jens1o 2017-04-10 14:44:59 +02:00
parent e49707fd1b
commit 5656246e5d
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@
"type": "string",
"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).",
"pattern": "^\\d+(?:K|M|G|)$"
"pattern": "^\\d+[KMG]?$"
}
}
}

View File

@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
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(
'The memory limit you\'d provided is not numeric, nor "-1" nor valid php shorthand notation!',
'Open settings'