Use MessageType enum instead of number literal
parent
38c8cac7c7
commit
12931ae6ba
|
@ -3,8 +3,14 @@
|
||||||
namespace LanguageServer;
|
namespace LanguageServer;
|
||||||
|
|
||||||
use LanguageServer\Server\TextDocument;
|
use LanguageServer\Server\TextDocument;
|
||||||
use LanguageServer\Protocol\{ServerCapabilities, ClientCapabilities, TextDocumentSyncKind, Message};
|
use LanguageServer\Protocol\{
|
||||||
use LanguageServer\Protocol\InitializeResult;
|
ServerCapabilities,
|
||||||
|
ClientCapabilities,
|
||||||
|
TextDocumentSyncKind,
|
||||||
|
Message,
|
||||||
|
MessageType,
|
||||||
|
InitializeResult
|
||||||
|
};
|
||||||
use AdvancedJsonRpc\{Dispatcher, ResponseError, Response as ResponseBody, Request as RequestBody};
|
use AdvancedJsonRpc\{Dispatcher, ResponseError, Response as ResponseBody, Request as RequestBody};
|
||||||
use Sabre\Event\Loop;
|
use Sabre\Event\Loop;
|
||||||
|
|
||||||
|
@ -141,7 +147,7 @@ class LanguageServer extends \AdvancedJsonRpc\Dispatcher
|
||||||
$uri = pathToUri($file);
|
$uri = pathToUri($file);
|
||||||
$fileNum++;
|
$fileNum++;
|
||||||
$shortName = substr($file, strlen($rootPath) + 1);
|
$shortName = substr($file, strlen($rootPath) + 1);
|
||||||
$this->client->window->logMessage(3, "Parsing file $fileNum/$numTotalFiles: $shortName.");
|
$this->client->window->logMessage(MessageType::INFO, "Parsing file $fileNum/$numTotalFiles: $shortName.");
|
||||||
|
|
||||||
$this->project->getDocument($uri)->updateContent(file_get_contents($file));
|
$this->project->getDocument($uri)->updateContent(file_get_contents($file));
|
||||||
|
|
||||||
|
@ -149,7 +155,7 @@ class LanguageServer extends \AdvancedJsonRpc\Dispatcher
|
||||||
} else {
|
} else {
|
||||||
$duration = (int)(microtime(true) - $startTime);
|
$duration = (int)(microtime(true) - $startTime);
|
||||||
$mem = (int)(memory_get_usage(true) / (1024 * 1024));
|
$mem = (int)(memory_get_usage(true) / (1024 * 1024));
|
||||||
$this->client->window->logMessage(3, "All PHP files parsed in $duration seconds. $mem MiB allocated.");
|
$this->client->window->logMessage(MessageType::INFO, "All PHP files parsed in $duration seconds. $mem MiB allocated.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue