diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a9a2a4..04f1099 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,17 +13,17 @@ jobs: matrix: include: - php: '7.4' - os: ubuntu-18.04 + os: ubuntu-22.04 - php: '8.0' - os: ubuntu-18.04 + os: ubuntu-22.04 - php: '8.1' - os: ubuntu-18.04 + os: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: '14.15.3' # renovate:keep-up-to-date + node-version: '16.14.2' # renovate:keep-up-to-date - name: Install npm dependencies run: npm ci - name: Setup PHP @@ -32,6 +32,8 @@ jobs: php-version: ${{ matrix.php }} extensions: ${{ matrix.xdebug }}, ast tools: composer + - name: Php Lint + uses: michaelw90/PHP-Lint@2.1.0 - name: Composer Install run: COMPOSER_ROOT_VERSION=dev-master composer install --prefer-dist --no-interaction - name: phpcs @@ -55,7 +57,7 @@ jobs: # - name: Setup Node.js # uses: actions/setup-node@v2 # with: -# node-version: '14.15.3' # renovate:keep-up-to-date +# node-version: '16.14.2' # renovate:keep-up-to-date # - name: Install npm dependencies # run: npm ci # - name: Build VS Code extension diff --git a/src/CompletionItem.php b/src/CompletionItem.php index 3e9757a..fcb3e1c 100644 --- a/src/CompletionItem.php +++ b/src/CompletionItem.php @@ -3,7 +3,9 @@ namespace LanguageServerProtocol; -class CompletionItem +use JsonSerializable; + +class CompletionItem implements JsonSerializable { /** * The label of this completion item. By default @@ -245,4 +247,18 @@ public function __construct( $this->data = $data; $this->insertTextFormat = $insertTextFormat; } + + /** + * This is needed because VSCode Does not like nulls + * meaning if a null is sent then this will not compute + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return array_filter(get_object_vars($this), function ($v) { + return $v !== null; + }); + } } diff --git a/src/Diagnostic.php b/src/Diagnostic.php index d355127..464216c 100644 --- a/src/Diagnostic.php +++ b/src/Diagnostic.php @@ -2,11 +2,13 @@ namespace LanguageServerProtocol; +use JsonSerializable; + /** * Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a * resource. */ -class Diagnostic +class Diagnostic implements JsonSerializable { /** * The range at which the message applies. @@ -118,4 +120,18 @@ public function __construct( $this->relatedInformation = $relatedInformation; $this->data = $data; } + + /** + * This is needed because VSCode Does not like nulls + * meaning if a null is sent then this will not compute + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return array_filter(get_object_vars($this), function ($v) { + return $v !== null; + }); + } } diff --git a/src/InlineValueClientCapabilities.php b/src/InlineValueClientCapabilities.php new file mode 100644 index 0000000..1f9c41a --- /dev/null +++ b/src/InlineValueClientCapabilities.php @@ -0,0 +1,20 @@ +dynamicRegistration = $dynamicRegistration; + } +} diff --git a/src/InlineValueContext.php b/src/InlineValueContext.php new file mode 100644 index 0000000..8a7dbb1 --- /dev/null +++ b/src/InlineValueContext.php @@ -0,0 +1,37 @@ +frameId = $frameId; + /** @psalm-suppress PossiblyNullPropertyAssignmentValue */ + $this->stoppedLocation = $stoppedLocation; + } +} diff --git a/src/InlineValueEvaluatableExpression.php b/src/InlineValueEvaluatableExpression.php new file mode 100644 index 0000000..21e8250 --- /dev/null +++ b/src/InlineValueEvaluatableExpression.php @@ -0,0 +1,43 @@ +range = $range; + $this->expression = $expression; + } +} diff --git a/src/InlineValueText.php b/src/InlineValueText.php new file mode 100644 index 0000000..ccf8f0b --- /dev/null +++ b/src/InlineValueText.php @@ -0,0 +1,37 @@ +range = $range; + /** @psalm-suppress PossiblyNullPropertyAssignmentValue */ + $this->text = $text; + } +} diff --git a/src/InlineValueVariableLookup.php b/src/InlineValueVariableLookup.php new file mode 100644 index 0000000..5c4b04e --- /dev/null +++ b/src/InlineValueVariableLookup.php @@ -0,0 +1,56 @@ +range = $range; + $this->variableName = $variableName; + /** @psalm-suppress PossiblyNullPropertyAssignmentValue */ + $this->caseSensitiveLookup = $caseSensitiveLookup; + } +} diff --git a/src/TextDocumentClientCapabilities.php b/src/TextDocumentClientCapabilities.php index 790243b..1713268 100644 --- a/src/TextDocumentClientCapabilities.php +++ b/src/TextDocumentClientCapabilities.php @@ -207,6 +207,15 @@ class TextDocumentClientCapabilities */ public $moniker; + /** + * Capabilities specific to the `textDocument/inlineValue` request. + * + * @since 3.17.0 + * + * @var InlineValueClientCapabilities|null + */ + public $inlineValue; + public function __construct( ?\LanguageServerProtocol\TextDocumentSyncClientCapabilities $synchronization = null, ?\LanguageServerProtocol\CompletionClientCapabilities $completion = null, @@ -233,7 +242,8 @@ public function __construct( ?\LanguageServerProtocol\LinkedEditingRangeClientCapabilities $linkedEditingRange = null, ?\LanguageServerProtocol\CallHierarchyClientCapabilities $callHierarchy = null, ?\LanguageServerProtocol\SemanticTokensClientCapabilities $semanticTokens = null, - ?\LanguageServerProtocol\MonikerClientCapabilities $moniker = null + ?\LanguageServerProtocol\MonikerClientCapabilities $moniker = null, + ?\LanguageServerProtocol\InlineValueClientCapabilities $inlineValue = null ) { $this->synchronization = $synchronization; $this->completion = $completion; @@ -261,5 +271,6 @@ public function __construct( $this->callHierarchy = $callHierarchy; $this->semanticTokens = $semanticTokens; $this->moniker = $moniker; + $this->inlineValue = $inlineValue; } }