You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Pest as my testing harness and phpactor seems to have a problem with finding its imported functions.
For example, in this code, I get a phpactor: Function "get" not found even though the test itself actually works correctly:
usefunctionPest\Laravel\get;
test('guests are redirected to the login page for admin dashboard', function () {
$response = get(route('admin.dashboard'));
$response->assertRedirect(route('login'));
});
I'm not sure if I'm doing something wrong or if this is a limitation of phpactor. If anyone has any insight, I'd love to hear.
So I ran that query and got no results. You wouldn't happen to know where the index is stored when it's being loaded as an LSP via Mason in neovim, would you? I'm not seeing any obvious files in my project or in the ~/.local/share/nvim/mason/packages/phpactor folders.
3:49:33 PM in mason/packages/phpactor
🔋 100% ➜ ./phpactor index:query "get"
3:49:40 PM in mason/packages/phpactor
🔋 100% ➜
Okay, I've never worked with pest so I haven't found the package I need to install for this to even get the get function into my project. But from the most recent documentation I found it would be $this->get which brings it back to the other linked issue.
Activity
mamazu commentedon Mar 25, 2026
Hm, interesting.
What version of phpactor are you using?
Is it in the index of phpactor?
phpactor index:query "get"If the answer is no maybe try clearing the index.
Just FYI there is already an issue with pest (completely unrelated) but it's not the first issue: #2344
nexxai commentedon Mar 25, 2026
So I ran that query and got no results. You wouldn't happen to know where the index is stored when it's being loaded as an LSP via Mason in neovim, would you? I'm not seeing any obvious files in my project or in the ~/.local/share/nvim/mason/packages/phpactor folders.
dantleech commentedon Mar 25, 2026
that should be
phpactor index:query Pest\\Laravel\\get:it's indexed, but indeed I do not get completion for it.
mamazu commentedon Mar 25, 2026
@dantleech Do you want to investigate it or should I? :D
dantleech commentedon Mar 25, 2026
I'm going to bed, so go for it 😆
mamazu commentedon Mar 26, 2026
Okay, I've never worked with pest so I haven't found the package I need to install for this to even get the
getfunction into my project. But from the most recent documentation I found it would be$this->getwhich brings it back to the other linked issue.https://laravel.com/docs/13.x/http-tests (first code block)
dantleech commentedon Mar 26, 2026
The function is defined in the
pest-plugin-laravelpackage. I'll invstigate why it's indexed bu not found.dantleech commentedon Mar 26, 2026
so it does work for me this morning - I suspect it's an indexing problem.
phpactor index:build --resetand restart your IDE might be a workaround.nexxai commentedon Mar 27, 2026
Is the index per project and if so, where do I actually run the rebuild command?
mamazu commentedon Mar 27, 2026
Run the index build command in your project directory. Then phpactor will know which index to rebuild.