Using getLocator autocompletion not working with custom namespace?

victor.vanherpt
victor.vanherpt Spryker Solution Partner Posts: 62 🪐 - Explorer
edited November 5 in Spryker Development

Hi! I set a new namespace for my new project modules.
I created a directory under src/, added it to composer autoload, and it works on normal execution.
But neither the IDE or Phpstan manage to resolve the client I created.
Here's the namespace config:


Adding it as a dependency:

You can already tell custom() can't be found by the IDE.

When running phpstan I get the following error:

╰─$ vendor/bin/phpstan analyze --memory-limit 4196M -c phpstan.neon
1578/1578 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

Line Pyz/Yves/CheckoutPage/CheckoutPageDependencyProvider.php

314 Call to an undefined method Generated\Yves\Ide\AutoCompletion&Spryker\Shared\Kernel\LocatorLocatorInterface::custom().

[ERROR] Found 1 error

In case someone wonders

Any ideas? I run the console commandsdev:ide-auto-completion:generate and dev:ide-auto-completion:client:generate

to no avail.

Answers

  • profuel
    profuel SSA Sprykee Posts: 78 🪐 - Explorer

    Could you please check, if your file src/Generated/Client/Ide/AutoCompletion.php contains your client?

    Since I don't have access to your repository, I cannot really help you.

    Hint. You may create a branch/fork for our Demoshop and extract there just your changes, stripping off all logic and obfuscating names.

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 62 🪐 - Explorer
    edited November 13

    Thanks, I was mainly wondering wether there was a known issue or not. If I'm supposed to have it working, I will check again just in case sometime.

    It'd be nice to have a clear guide in the docs though, this being a recommendation.