Score:2

How can I get IntelliSense/Intelephense to look inside a Drupal Docker Container?

kr flag

I am developing a Drupal site using the latest official Drupal/PHP/Apache Docker image.

I have some local directories mapped to inside the Drupal container as expected (modules, profiles, sites, themes).

When I create a module and try to, for example, extend a Drupal class such as BlockBase, I get an error saying BlockBase is undefined. This is because the Drupal core code is inside of the container, which intelephense and intellisense can't see. Note the code is actually perfectly fine when it is run.

This problem also means I don't get any autocompletion or suggestions for methods and such.

Is there a way to resolve this issue, for example by somehow giving intelephense access to inside of the container?

Thank you.

Score:2
cn flag

You could use VS Code Remote Development.

Then extensions like Intelephense run in the container and see the entire code.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.