Skip to content

Commit 378801f

Browse files
iluuu1994felixfbecker
authored andcommitted
feat: Allow [int, int] tuple for ParameterInformation label
According to the docs a start/stop position can be provided as the ParameterInformation label that denotes the position of the parameter in the SignatureInformation label.
1 parent 4f1fb5e commit 378801f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/ParameterInformation.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@
99
class ParameterInformation
1010
{
1111
/**
12-
* The label of this signature. Will be shown in
13-
* the UI.
12+
* The label of this parameter information.
1413
*
15-
* @var string
14+
* Either a string or an inclusive start and exclusive end offsets within its containing
15+
* signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
16+
* string representation as `Position` and `Range` does.
17+
*
18+
* *Note*: a label of type string should be a substring of its containing signature label.
19+
* Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
20+
*
21+
* @var string|int[]
1622
*/
1723
public $label;
1824

@@ -27,11 +33,11 @@ class ParameterInformation
2733
/**
2834
* Create ParameterInformation
2935
*
30-
* @param string $label The label of this signature. Will be shown in the UI.
36+
* @param string|int[] $label The label of this parameter information.
3137
* @param string $documentation The human-readable doc-comment of this signature. Will be shown in the UI but can
3238
* be omitted.
3339
*/
34-
public function __construct(string $label, string $documentation = null)
40+
public function __construct($label, string $documentation = null)
3541
{
3642
$this->label = $label;
3743
$this->documentation = $documentation;

0 commit comments

Comments
 (0)