Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork151
phpactor can't find standard functions and classes definitions#2952
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Let me explain in details:
(it is the same phpactor, I linked it:
The file itself IS exist, by the way:
BTW, sometimes (I don't remember when exactly) I got the following errors in LSP log file: I have tried to create config in But nothing changed.
I spentso much time on this problem. Tried to debug phpactor source code. But nothing works. And I have no idea what to do next. Why doesn't it work? 😢 |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 3 comments 2 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Well... I found out ugly solution, I guess...
and added this line instead:
Project still contain stubs in it's vendor directory:
And now(crossing fingers) after reindex the project it works! I can go to definition of different "parts" of stub from different versions of PHP and different extensions. Such as |
BetaWas this translation helpful?Give feedback.
All reactions
-
why have you done that? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Because if I install stubs somewhere else nvim runs two instances of phpactor (two language servers at the same time). I don't know why, I just started to learn all this. Anyway, nvim switches between instances by some rules that I don't understand. And behavior that I get is like:well, uhm, I don't know what function it is... Oh, you pressed |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
that's expected with the stub You can't jump to definition as the stub is in the PHAR. You can however look at the "hover" information, looking at the stub source code might be nice, but actually not required as you can read the docs and methd signature in the hover information. Alternatively you can install Phactor without the PHAR and it will work as you expected without any other changes. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I respect it. But after using PhpStorm (and other JB products) for years I developed a habit - I like to jump right in source code of standard library and read it (and I do the same with Go, Java, etc...). (Not sure do you know or not, but In PhpStorm jump into stub works perfectly.) It is very-very comfortable when I just don't remember, let's say, what string functions exist and want to see them all.
Little problem with it is that Mason (plugin for nvim for autoinstall LSP, Linters and so on) can only install phar-version of phpactor, as far as I know. And in the end I have a situation when everything installed via Mason and phpactor installed manually, but via Mason, haha. Some kind of solution I described in my second post in this discussion, but yeah, it's ugly. |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #2951 on November 05, 2025 17:15.