1
0
Fork 0
pull/189/merge
Michal Niewrzal 2017-01-05 07:30:58 +00:00 committed by GitHub
commit 81e6412cb1
1 changed files with 50 additions and 46 deletions

View File

@ -10,21 +10,19 @@ use LanguageServer\Protocol\{
Message,
MessageType,
InitializeResult,
SymbolInformation,
TextDocumentIdentifier,
CompletionOptions
};
use LanguageServer\FilesFinder\{FilesFinder, ClientFilesFinder, FileSystemFilesFinder};
use LanguageServer\ContentRetriever\{ContentRetriever, ClientContentRetriever, FileSystemContentRetriever};
use LanguageServer\Index\{DependenciesIndex, GlobalIndex, Index, ProjectIndex, StubsIndex};
use AdvancedJsonRpc;
use Sabre\Event\{Loop, Promise};
use Sabre\Event\Promise;
use function Sabre\Event\coroutine;
use Exception;
use Throwable;
use Webmozart\PathUtil\Path;
use Webmozart\Glob\Glob;
use Sabre\Uri;
use function Sabre\Event\Loop\setTimeout;
class LanguageServer extends AdvancedJsonRpc\Dispatcher
{
@ -184,6 +182,12 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
// workspace/symbol should only look inside the project source and dependencies
$this->workspace = new Server\Workspace($projectIndex, $this->client);
if (extension_loaded('xdebug')) {
setTimeout(function () {
$this->client->window->showMessage(MessageType::WARNING, 'You are running PHP Language Server with xdebug enabled. This has a major impact on server performance.');
}, 1);
}
$serverCapabilities = new ServerCapabilities();
// Ask the client to return always full documents (because we need to rebuild the AST from scratch)
$serverCapabilities->textDocumentSync = TextDocumentSyncKind::FULL;