1
0
Fork 0

fixed param counting

pull/250/head
Ivan Bozhanov 2017-01-20 15:36:10 +02:00
parent 3b4e0c3275
commit a7c094eacb
1 changed files with 3 additions and 3 deletions

View File

@ -162,12 +162,12 @@ class SignatureHelpProvider
} }
$help->activeSignature = 0; $help->activeSignature = 0;
$help->activeParameter = 0; $help->activeParameter = 0;
$params = ltrim($params, "( ");
if (strlen(trim($params))) { if (strlen(trim($params))) {
try { try {
$params = $this->parser->parse('<?php $a = [' . $params . '];', $this->parserErrorHandler)[0]->expr->items; $params = $this->parser->parse('<?php $a = [' . $params . '];', $this->parserErrorHandler)[0]->expr->items;
$help->activeParameter = count($params); $help->activeParameter = count($params) - 1;
} catch (\Exception $e) { } catch (\Exception $ignore) { }
}
} }
$help->signatures[] = $signature; $help->signatures[] = $signature;
} }