1
0
Fork 0

Catch parse error in indexing

pull/83/head
Felix Becker 2016-10-14 00:38:17 +02:00
parent 4db7ffd88c
commit 3db514dd89
1 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,7 @@ use LanguageServer\Protocol\{
};
use AdvancedJsonRpc\{Dispatcher, ResponseError, Response as ResponseBody, Request as RequestBody};
use Sabre\Event\Loop;
use Exception;
class LanguageServer extends \AdvancedJsonRpc\Dispatcher
{
@ -160,7 +161,11 @@ class LanguageServer extends \AdvancedJsonRpc\Dispatcher
$this->client->window->logMessage(MessageType::INFO, "Not parsing $shortName because it exceeds size limit of 0.5MB");
} else {
$this->client->window->logMessage(MessageType::INFO, "Parsing file $fileNum/$numTotalFiles: $shortName.");
$this->project->loadDocument($uri);
try {
$this->project->loadDocument($uri);
} catch (Exception $e) {
$this->client->window->logMessage(MessageType::ERROR, "Error parsing file $shortName: " . $e->getMessage());
}
}
Loop\setTimeout($processFile, 0);