diff --git a/package.json b/package.json index d3cbd4c..27074fc 100644 --- a/package.json +++ b/package.json @@ -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]?$" } } } diff --git a/src/extension.ts b/src/extension.ts index cd64bfe..028120e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext): Promise const memoryLimit = conf.get('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'