extensions/felixfbecker.php-intellisense-0.0.12/vendor/felixfbecker/language-server/src/Project.php
/**
     * Loads the document by doing a textDocument/xcontent request to the client.
     * If the client does not support textDocument/xcontent, tries to read the file from the file system.
     * The document is NOT added to the list of open documents, but definitions are registered.
     *
     * @param string $uri
     * @return Promise <PhpDocument>
     */
Loads the document by doing a textDocument/xcontent request to the client.
If the client does not support textDocument/xcontent, tries to read the file from the file system.
The document is NOT added to the list of open documents, but definitions are registered.

@param string $uri
@return Promise 
Loads the document by doing a textDocument / xcontent request to the client . If the client does not support textDocument / xcontent tries to read the file from the file system . The document is NOT added to the list of open documents but definitions are registered . @param string $uri @return Promise
public function loadDocument(string $uri): Promise
    {
        return coroutine(function () use ($uri) {
            $limit = 150000;
            if ($this->clientCapabilities->xcontentProvider) {
                $content = (yield $this->client->textDocument->xcontent(new TextDocumentIdentifier($uri)))->text;
                $size = strlen($content);
                if ($size > $limit) {
                    throw new ContentTooLargeException($uri, $size, $limit);
                }
            } else {
                $path = uriToPath($uri);
                $size = filesize($path);
                if ($size > $limit) {
                    throw new ContentTooLargeException($uri, $size, $limit);
                }
                $content = file_get_contents($path);
            }
            if (isset($this->documents[$uri])) {
                $document = $this->documents[$uri];
                $document->updateContent($content);
            } else {
                $document = new PhpDocument($uri, $content, $this, $this->client, $this->parser, $this->docBlockFactory);
            }
            return $document;
        });
    }
public function loadDocument ( string $ uri ) : Promise { return coroutine ( function ( ) use ( $ uri ) { $ limit = 150000 ; if ( $ this -> clientCapabilities -> xcontentProvider ) { $ content = ( yield $ this -> client -> textDocument -> xcontent ( new TextDocumentIdentifier ( $ uri ) ) ) -> text ; $ size = strlen ( $ content ) ; if ( $ size > $ limit ) { throw new ContentTooLargeException ( $ uri , $ size , $ limit ) ; } } else { $ path = uriToPath ( $ uri ) ; $ size = filesize ( $ path ) ; if ( $ size > $ limit ) { throw new ContentTooLargeException ( $ uri , $ size , $ limit ) ; } $ content = file_get_contents ( $ path ) ; } if ( isset ( $ this -> documents [ $ uri ] ) ) { $ document = $ this -> documents [ $ uri ] ; $ document -> updateContent ( $ content ) ; } else { $ document = new PhpDocument ( $ uri , $ content , $ this , $ this -> client , $ this -> parser , $ this -> docBlockFactory ) ; } return $ document ; } ) ; }
Loads the document by doing a textDocument/xcontent request to the client.
Loads the document by doing a textDocument / xcontent request to the client .