felixfbecker / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
1.16k stars 185 forks source link

Find all references on `define` function fails #500

Open jens1o opened 7 years ago

jens1o commented 7 years ago

Errorcode:

[Error - 9:14:20 PM] Request textDocument/references failed.
  Message: InvalidArgumentException: Not a valid file URI: phpstubs:Core/Core_d.php in C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\src\utils.php:42
Stack trace:
#0 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\src\ContentRetriever\FileSystemContentRetriever.php(22): LanguageServer\uriToPath('phpstubs:Core/C...')
#1 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\src\PhpDocumentLoader.php(110): LanguageServer\ContentRetriever\FileSystemContentRetriever->retrieve('phpstubs:Core/C...')
#2 [internal function]: LanguageServer\PhpDocumentLoader->LanguageServer\{closure}()
#3 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\coroutine.php(64): Generator->valid()
#4 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\coroutine.php(118): Sabre\Event\{closure}()
#5 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\src\PhpDocumentLoader.php(123): Sabre\Event\coroutine(Object(Closure))
#6 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\src\PhpDocumentLoader.php(94): LanguageServer\PhpDocumentLoader->load('phpstubs:Core/C...')
#7 [internal function]: LanguageServer\PhpDocumentLoader->getOrLoad('phpstubs:Core/C...')
#8 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\src\Server\TextDocument.php(238): array_map(Array, Array)
#9 [internal function]: LanguageServer\Server\TextDocument->LanguageServer\Server\{closure}()
#10 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\coroutine.php(70): Generator->send(Object(LanguageServer\PhpDocument))
#11 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\Promise.php(242): Sabre\Event\{closure}(Object(LanguageServer\PhpDocument))
#12 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\Loop\Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#13 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\Loop\Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#14 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\Loop\Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#15 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\sabre\event\lib\Loop\functions.php(122): Sabre\Event\Loop\Loop->run()
#16 C:\Users\Jens\.vscode-insiders\extensions\felixfbecker.php-intellisense-1.5.2\vendor\felixfbecker\language-server\bin\php-language-server.php(50): Sabre\Event\Loop\run()
#17 {main}
  Code: -32603 

Steps to reproduce:

Actually, I expected to not lookup define, but instead get all places where the constant is being used.

felixfbecker commented 7 years ago

Could you clarify what you mean with "Jump into a line like this"? Did you do "go to definition" on define? What do you mean with "go to the very beginning"?

jens1o commented 7 years ago

Jump into a line like this: Well, I just used my arrow keys as long as I'm not in a line like I provided(so manually). Go to the very beginning: Place the cursor before the d of define(so the first character)