12
12
13
13
use type Facebook\HHAST\__Private\{
14
14
Asio\AsyncPoll ,
15
- LintRunConfig ,
16
15
LintRunLSPPublishDiagnosticsEventHandler ,
17
16
LintRun ,
18
17
};
21
20
use namespace HH\Lib\Str ;
22
21
23
22
final class Server extends LSPLib \Server <ServerState > {
24
- public function __construct (
25
- private ITerminal $terminal ,
26
- private ?LintRunConfig $config ,
27
- private vec <string > $roots ,
28
- ) {
23
+ public function __construct (private ITerminal $terminal ) {
29
24
parent :: __construct(new LSPImpl \Client ($terminal ), new ServerState ());
30
25
}
31
26
@@ -34,7 +29,7 @@ protected function getSupportedServerCommands(): vec<LSPLib\ServerCommand> {
34
29
return vec [
35
30
new LSPImpl \InitializeCommand ($this -> state ),
36
31
new LSPLib \ShutdownCommand ($this -> state ),
37
- new LSPImpl \CodeActionCommand ($this -> client , $this -> config , $this -> state ),
32
+ new LSPImpl \CodeActionCommand ($this -> client , $this -> state ),
38
33
new LSPImpl \ExecuteCommandCommand ($this -> client ),
39
34
];
40
35
}
@@ -45,19 +40,10 @@ protected function getSupportedClientNotifications(
45
40
return vec [
46
41
new LSPImpl \DidChangeWatchedFilesNotification (
47
42
$this -> client ,
48
- $this -> config ,
49
- $this -> state ,
50
- ),
51
- new LSPImpl \DidSaveTextDocumentNotification (
52
- $this -> client ,
53
- $this -> config ,
54
- $this -> state ,
55
- ),
56
- new LSPImpl \DidOpenTextDocumentNotification (
57
- $this -> client ,
58
- $this -> config ,
59
43
$this -> state ,
60
44
),
45
+ new LSPImpl \DidSaveTextDocumentNotification ($this -> client , $this -> state ),
46
+ new LSPImpl \DidOpenTextDocumentNotification ($this -> client , $this -> state ),
61
47
new LSPImpl \DidCloseTextDocumentNotification ($this -> client , $this -> state ),
62
48
new LSPImpl \ExitNotification ($this -> state ),
63
49
new LSPImpl \InitializedNotification ($this -> client , $this -> state ),
@@ -116,7 +102,14 @@ protected function getSupportedClientNotifications(
116
102
117
103
$handler =
118
104
new LintRunLSPPublishDiagnosticsEventHandler ($this -> client , $this -> state );
119
- await (new LintRun ($this -> config , $handler , $this -> roots ))-> runAsync();
105
+ await (
106
+ new LintRun (
107
+ $this -> state -> config ,
108
+ $handler ,
109
+ $this -> state -> config ?-> getRoots() ?? vec [],
110
+ )
111
+ )
112
+ -> runAsync();
120
113
}
121
114
122
115
private async function readMessageAsync (): Awaitable <string > {
0 commit comments