diff --git a/src/LanguageServer.php b/src/LanguageServer.php index d652fb0..1696ac2 100644 --- a/src/LanguageServer.php +++ b/src/LanguageServer.php @@ -220,11 +220,11 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher $textDocuments = []; return Promise\all(array_map(function ($pattern) use (&$textDocuments) { return coroutine(function () use ($pattern, &$textDocuments) { - $pattern = Path::makeAbsolute($pattern, $this->rootPath); - foreach (new GlobIterator($pattern) as $path) { - $textDocuments[] = new TextDocumentIdentifier(pathToUri($path)); - yield timeout(); - } + $pattern = Path::makeAbsolute($pattern, $this->rootPath); + foreach (new GlobIterator($pattern) as $path) { + $textDocuments[] = new TextDocumentIdentifier(pathToUri($path)); + yield timeout(); + } }); }, $patterns))->then(function () use ($textDocuments) { return $textDocuments;