reformatcode

pull/102/head
jens1o 2017-04-10 14:30:05 +02:00
parent 35cd9c8074
commit 021c3655c5
2 changed files with 3 additions and 2 deletions

View File

@ -61,7 +61,8 @@
"php.memoryLimit": { "php.memoryLimit": {
"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).",
"schema": "!/^\d+(?:K|M|G|)$/"
} }
} }
} }

View File

@ -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' && !memoryLimit.match('~^(\d+)(K|M|G|)$~')) { if (memoryLimit !== '-1' && !/^\d+(?:K|M|G|)$/.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'