Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-injecting service in constructor is too high priority #2350

Open
jannes-io opened this issue Apr 17, 2024 · 2 comments
Open

Auto-injecting service in constructor is too high priority #2350

jannes-io opened this issue Apr 17, 2024 · 2 comments

Comments

@jannes-io
Copy link

When I have the following class:

class Test
{
    public function __construct(private readonly EntityRepository $productRepository)
    {
    }

    public function test()
    {
    }
}

And I type some code in the test function like:

$this->produ

Instead of suggesting the already injected $productRepository, it is recommending me other services first and then the already injected service.
image

Expected behavior:
Always favor already injected services in code autocomplete over service suggestions.

@Haehnchen
Copy link
Owner

yeah, they are already highly downvoted. will try to fine tune it.

@jannes-io
Copy link
Author

@Haehnchen it's still way too aggressive on auto injecting.. Even suggesting functions inside of services before the one that's already injected.

Is there a way to just completely disable this feature? It's hindering me personally more than it helps. 99/100 I already know what services I'll need and have already injected them manually...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants