felixfbecker / vscode-php-intellisense

Advanced PHP IntelliSense for Visual Studio Code 🆚💬
MIT License
413 stars 88 forks source link

Find All References, Got To, Peek Definition dont work in all projects #158

Open ambrosso opened 7 years ago

ambrosso commented 7 years ago

Find All References, Got To Definition, Peek Definition work not in all projects.

In some opened workspaces 'Find All References' works only for $variables, but not for functions, strings, etc. I see only "Loading..." text and nothing more. And 'Got To Definition', 'Peek Definition' dont work for 'variable_name' or 'function_name' in quotation marks or I see spinning wheel effect. But in most projects it is OK. Example where it doest work: https://downloads.wordpress.org/plugin/wordpress-seo.5.5.1.zip

I have no errors in Console and Output. Tried on Windows and MAC OS, latest VS Code 1.16.1 and 1.17 insides What additions info I need to provide?

And do I need to install php-language-server, or only PHP IntelliSense extension is enough for VS Code?

seanmars commented 7 years ago

Same problem, and Workspace symbol search not working too. And can not go to the include file.

GeorgeWells commented 6 years ago

Might link to the issue I keep encountering which I raised on VS Code Github: https://github.com/Microsoft/vscode/issues/24506

kwilliams1987 commented 6 years ago

Possibly related:

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

Only seems to happen when the file I try to get references for is marked as Modified by GIT. Note that the path starts with git:// instead of file:// which might be the problem.

Yalhu commented 6 years ago

It doesn't work when html/javascript file mixed to php file. If it is a pure php file, it works well.

alannaidon commented 6 years ago

Same error here. Now for some reason I can see the "Go To Definition" option when right click the function call. But it always shows "No definition found for functionName"