PHP code example of phpactor / language-server-protocol

1. Go to this page and download the library: Download phpactor/language-server-protocol library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpactor / language-server-protocol example snippets


$item = CompletionItem::fromArray([
    'label' => 'Foobar',
    'kind' => 1,
    'detail' => 'This is foobar',
    'documentation' => [
        'kind' => 'markdown',
        'value' => 'Foobar',
    ],
    'additionalTextEdits' => [
        [
            'range' => [
                'start' => [
                    'line' => 5,
                    'character' => 10,
                ],
                'end' => [
                    'line' => 10,
                    'character' => 10,
                ],
            ],
            'newText' => 'Foobar',
        ],
    ],
    'command' => [
        'title' => 'Foobar',
        'command' => 'my.command',
    ],
]);