Skip to content

Commit be4d3d6

Browse files
committed
Add functionality for rootUri
1 parent 18c6ccd commit be4d3d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LanguageServer.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,13 @@ public function __construct(ProtocolReader $reader, ProtocolWriter $writer)
165165
* @param int|null $processId The process Id of the parent process that started the server. Is null if the process has not been started by another process. If the parent process is not alive then the server should exit (see exit notification) its process.
166166
* @return Promise <InitializeResult>
167167
*/
168-
public function initialize(ClientCapabilities $capabilities, string $rootPath = null, int $processId = null): Promise
168+
public function initialize(ClientCapabilities $capabilities, string $rootUri = null, string $rootPath = null, int $processId = null): Promise
169169
{
170+
if ($rootPath == null) {
171+
if (substr($rootUri,0,4) === "file") {
172+
$rootPath = substr($rootUri,7);
173+
}
174+
}
170175
return coroutine(function () use ($capabilities, $rootPath, $processId) {
171176

172177
if ($capabilities->xfilesProvider) {

0 commit comments

Comments
 (0)