From 021c3655c5bfd976688ce80b8cfa431c358bf113 Mon Sep 17 00:00:00 2001 From: jens1o Date: Mon, 10 Apr 2017 14:30:05 +0200 Subject: [PATCH] reformatcode --- package.json | 3 ++- src/extension.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1e8339e..f8bf025 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "php.memoryLimit": { "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)." + "description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM(default).", + "schema": "!/^\d+(?:K|M|G|)$/" } } } diff --git a/src/extension.ts b/src/extension.ts index 8f5f491..6bce406 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' && !memoryLimit.match('~^(\d+)(K|M|G|)$~')) { + if (memoryLimit !== '-1' && !/^\d+(?:K|M|G|)$/.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'