Skip to content

Commit c4b1ace

Browse files
committed
InlineValue capability
1 parent a9e113d commit c4b1ace

6 files changed

+202
-1
lines changed

src/InlineValueClientCapabilities.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace LanguageServerProtocol;
4+
5+
class InlineValueClientCapabilities
6+
{
7+
8+
/**
9+
* Whether implementation supports dynamic registration for inline value providers.
10+
*
11+
* @var bool|null
12+
*/
13+
public $dynamicRegistration;
14+
15+
public function __construct(
16+
?bool $dynamicRegistration = null
17+
) {
18+
$this->dynamicRegistration = $dynamicRegistration;
19+
}
20+
}

src/InlineValueContext.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace LanguageServerProtocol;
4+
5+
/**
6+
* @since 3.17.0
7+
*/
8+
class InlineValueContext
9+
{
10+
/**
11+
* The stack frame (as a DAP Id) where the execution has stopped.
12+
*
13+
* @var int|null
14+
*/
15+
public $frameId;
16+
17+
/**
18+
* The document range where execution has stopped.
19+
* Typically the end position of the range denotes the line where the
20+
* inline values are shown.
21+
*
22+
* @var Range|null
23+
*/
24+
public $stoppedLocation;
25+
26+
/**
27+
* @param int|null $frameId stack frame Id
28+
* @param Range|null $stoppedLocation Range
29+
*/
30+
public function __construct(?int $frameId = null, ?\LanguageServerProtocol\Range $stoppedLocation = null)
31+
{
32+
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
33+
$this->frameId = $frameId;
34+
$this->stoppedLocation = $stoppedLocation;
35+
}
36+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace LanguageServerProtocol;
4+
5+
/**
6+
* Provide an inline value through an expression evaluation.
7+
*
8+
* If only a range is specified, the expression will be extracted from the
9+
* underlying document.
10+
*
11+
* An optional expression can be used to override the extracted expression.
12+
*
13+
* @since 3.17.0
14+
*/
15+
class InlineValueEvaluatableExpression
16+
{
17+
/**
18+
* The document range for which the inline value applies.
19+
* The range is used to extract the evaluatable expression from the
20+
* underlying document.
21+
*
22+
* @var Range|null
23+
*/
24+
public $range;
25+
26+
/**
27+
* If specified the expression overrides the extracted expression.
28+
*
29+
* @var string|null
30+
*/
31+
public $expression;
32+
33+
/**
34+
* @param Range|null $range Range
35+
* @param string|null $expression expression
36+
*/
37+
public function __construct(?\LanguageServerProtocol\Range $range = null, ?string $expression = null)
38+
{
39+
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
40+
$this->range = $range;
41+
$this->expression = $expression;
42+
}
43+
}

src/InlineValueText.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace LanguageServerProtocol;
4+
5+
/**
6+
* Provide inline value as text.
7+
*
8+
* @since 3.17.0
9+
*/
10+
class InlineValueText
11+
{
12+
/**
13+
* The document range for which the inline value applies.
14+
*
15+
* @var Range|null
16+
*/
17+
public $range;
18+
19+
/**
20+
* The text of the inline value.
21+
*
22+
* @var string|null
23+
*/
24+
public $text;
25+
26+
/**
27+
* @param Range|null $range Range
28+
* @param string|null $text Text
29+
*/
30+
public function __construct(?\LanguageServerProtocol\Range $range = null, ?string $text = null)
31+
{
32+
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
33+
$this->range = $range;
34+
$this->text = $text;
35+
}
36+
}

src/InlineValueVariableLookup.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace LanguageServerProtocol;
4+
5+
/**
6+
* Provide inline value through a variable lookup.
7+
*
8+
* If only a range is specified, the variable name will be extracted from
9+
* the underlying document.
10+
*
11+
* An optional variable name can be used to override the extracted name.
12+
*
13+
* @since 3.17.0
14+
*/
15+
class InlineValueVariableLookup
16+
{
17+
/**
18+
* The document range for which the inline value applies.
19+
* The range is used to extract the variable name from the underlying
20+
* document.
21+
*
22+
* @var Range|null
23+
*/
24+
public $range;
25+
26+
/**
27+
* If specified the name of the variable to look up.
28+
*
29+
* @var string|null
30+
*/
31+
public $variableName;
32+
33+
/**
34+
* How to perform the lookup.
35+
*
36+
* @var bool|null
37+
*/
38+
public $caseSensitiveLookup;
39+
40+
/**
41+
* @param Range|null $range Range
42+
* @param string|null $variableName variableName
43+
* @param bool|null $caseSensitiveLookup caseSensitiveLookup
44+
*/
45+
public function __construct(
46+
?\InlineValueVariableLookup\Range $range = null,
47+
?string $variableName = null,
48+
?bool $caseSensitiveLookup = null
49+
) {
50+
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
51+
$this->range = $range;
52+
$this->variableName = $variableName;
53+
$this->caseSensitiveLookup = $caseSensitiveLookup;
54+
}
55+
}

src/TextDocumentClientCapabilities.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,15 @@ class TextDocumentClientCapabilities
207207
*/
208208
public $moniker;
209209

210+
/**
211+
* Capabilities specific to the `textDocument/inlineValue` request.
212+
*
213+
* @since 3.17.0
214+
*
215+
* @var InlineValueClientCapabilities|null
216+
*/
217+
public $inlineValue;
218+
210219
public function __construct(
211220
?\LanguageServerProtocol\TextDocumentSyncClientCapabilities $synchronization = null,
212221
?\LanguageServerProtocol\CompletionClientCapabilities $completion = null,
@@ -233,7 +242,8 @@ public function __construct(
233242
?\LanguageServerProtocol\LinkedEditingRangeClientCapabilities $linkedEditingRange = null,
234243
?\LanguageServerProtocol\CallHierarchyClientCapabilities $callHierarchy = null,
235244
?\LanguageServerProtocol\SemanticTokensClientCapabilities $semanticTokens = null,
236-
?\LanguageServerProtocol\MonikerClientCapabilities $moniker = null
245+
?\LanguageServerProtocol\MonikerClientCapabilities $moniker = null,
246+
?\LanguageServerProtocol\InlineValueClientCapabilities $inlineValue = null
237247
) {
238248
$this->synchronization = $synchronization;
239249
$this->completion = $completion;
@@ -261,5 +271,6 @@ public function __construct(
261271
$this->callHierarchy = $callHierarchy;
262272
$this->semanticTokens = $semanticTokens;
263273
$this->moniker = $moniker;
274+
$this->inlineValue = $inlineValue;
264275
}
265276
}

0 commit comments

Comments
 (0)