extensions/felixfbecker.php-intellisense-0.0.12/vendor/felixfbecker/language-server/src/LanguageServer.php
/**
     * Parses workspace files, one at a time.
     *
     * @return Promise <void>
     */
Parses workspace files, one at a time.
@return Promise 
Parses workspace files one at a time . @return Promise
private function indexProject(): Promise
    {
        return coroutine(function () {
            $textDocuments = yield $this->findPhpFiles();
            $count = count($textDocuments);
            $startTime = microtime(true);
            foreach ($textDocuments as $i => $textDocument) {
                yield timeout();
                $this->client->window->logMessage(
                    MessageType::LOG,
                    "Parsing file $i/$count: {$textDocument->uri}"
                );
                try {
                    yield $this->project->loadDocument($textDocument->uri);
                } catch (ContentTooLargeException $e) {
                    $this->client->window->logMessage(
                        MessageType::INFO,
                        "Ignoring file {$textDocument->uri} because it exceeds size limit of {$e->limit} bytes ({$e->size})"
                    );
                } catch (Exception $e) {
                    $this->client->window->logMessage(
                        MessageType::ERROR,
                        "Error parsing file {$textDocument->uri}: " . (string)$e
                    );
                }
            }
            $duration = (int)(microtime(true) - $startTime);
            $mem = (int)(memory_get_usage(true) / (1024 * 1024));
            $this->client->window->logMessage(
                MessageType::INFO,
                "All $count PHP files parsed in $duration seconds. $mem MiB allocated."
            );
        });
    }
private function indexProject ( ) : Promise { return coroutine ( function ( ) { $ textDocuments = yield $ this -> findPhpFiles ( ) ; $ count = count ( $ textDocuments ) ; $ startTime = microtime ( true ) ; foreach ( $ textDocuments as $ i => $ textDocument ) { yield timeout ( ) ; $ this -> client -> window -> logMessage ( MessageType :: LOG , " Parsing file  $ i / $ count :  { $ textDocument -> uri } " ) ; try { yield $ this -> project -> loadDocument ( $ textDocument -> uri ) ; } catch ( ContentTooLargeException $ e ) { $ this -> client -> window -> logMessage ( MessageType :: INFO , " Ignoring file  { $ textDocument -> uri }  because it exceeds size limit of  { $ e -> limit }  bytes ( { $ e -> size } ) " ) ; } catch ( Exception $ e ) { $ this -> client -> window -> logMessage ( MessageType :: ERROR , " Error parsing file  { $ textDocument -> uri } :  " . ( string ) $ e ) ; } } $ duration = ( int ) ( microtime ( true ) - $ startTime ) ; $ mem = ( int ) ( memory_get_usage ( true ) / ( 1024 * 1024 ) ) ; $ this -> client -> window -> logMessage ( MessageType :: INFO , " All  $ count  PHP files parsed in  $ duration  seconds.  $ mem  MiB allocated. " ) ; } ) ; }
Parses workspace files, one at a time.
Parses workspace files one at a time .
// Give LS to the chance to handle requests while indexing