-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathWindow.php
More file actions
48 lines (42 loc) Β· 1.21 KB
/
Window.php
File metadata and controls
48 lines (42 loc) Β· 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types = 1);
namespace LanguageServer\Client;
use LanguageServer\ClientHandler;
use Sabre\Event\Promise;
/**
* Provides method handlers for all window/* methods
*/
class Window
{
/**
* @var ClientHandler
*/
private $handler;
public function __construct(ClientHandler $handler)
{
$this->handler = $handler;
}
/**
* The show message notification is sent from a server to a client
* to ask the client to display a particular message in the user interface.
*
* @param int $type
* @param string $message
* @return Promise <void>
*/
public function showMessage(int $type, string $message): Promise
{
return $this->handler->notify('window/showMessage', ['type' => $type, 'message' => $message]);
}
/**
* The log message notification is sent from the server to the client to ask the client to log a particular message.
*
* @param int $type
* @param string $message
* @return Promise <void>
*/
public function logMessage(int $type, string $message): \Generator
{
yield from $this->handler->notify('window/logMessage', ['type' => $type, 'message' => $message]);
}
}