Repository navigation
Not finding imported functions #3035
Description
Activity
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
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% ➜
that should be
phpactor index:query Pest\\Laravel\\get:phpactor index:query Pest\\Laravel\\get Function:Pest\Laravel\get Path:file://blah/vendor/pestphp/pest-plugin-laravel/src/Http.phpit's indexed, but indeed I do not get completion for it.
@dantleech Do you want to investigate it or should I? :D
Do you want to investigate it or should I?
I'm going to bed, so go for it 😆
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)
The function is defined in the
pest-plugin-laravelpackage. I'll invstigate why it's indexed bu not found.Reacted by mamazuso 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.Is the index per project and if so, where do I actually run the rebuild command?
Run the index build command in your project directory. Then phpactor will know which index to rebuild.
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 foundeven though the test itself actually works correctly: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.
Source:
