VS Code Joomla Setup Topic is solved

For Joomla! 4.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
cappuccino
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Tue Aug 04, 2009 3:49 pm
Location: Hamburg
Contact:

VS Code Joomla Setup

Post by cappuccino » Tue Oct 05, 2021 7:48 pm

Hi,I need some help in setup VS Code for Joomla. I enabled PHP Intelephense which causes all my files show errors on Joomla classes. - I tried to follow the documentation here https://docs.joomla.org/Visual_Studio_Code. I separated my Joomla coding from the Joomla instance on my computer, which seems to be pretty similar to the one mentioned in this thread on stackexchange https://joomla.stackexchange.com/questi ... for-joomla. As far as I know this has something to do with the intelephense.environment.includePaths. I just cannot figure out on how to make this working. Any ideas?

carlitorweb
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue May 08, 2018 9:03 pm

Re: VS Code Joomla Setup

Post by carlitorweb » Wed Oct 06, 2021 2:16 pm

Create a .vscode folder in your workspace. Inside create settings.json file and write the follow:

Code: Select all

{
    "intelephense.environment.includePaths": [
        "/path/to/Joomla/Instance/root/folder",
    ]
}
With this, when you open this workspace, intelephense will know where search for class definition. That is all you need to know.

You can do the same in the settings of the extension, where you can put it as global for any workspace or folder you open in vscode.

cappuccino
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Tue Aug 04, 2009 3:49 pm
Location: Hamburg
Contact:

Re: VS Code Joomla Setup

Post by cappuccino » Thu Oct 07, 2021 4:21 pm

It works perfectly. If I install extensions in my main Joomla instance their classes and functions gets discovered, too. Thanks for the hint.

User avatar
Gasoline
Joomla! Explorer
Joomla! Explorer
Posts: 425
Joined: Tue Aug 23, 2005 10:33 am
Location: NL

Re: VS Code Joomla Setup

Post by Gasoline » Fri Oct 08, 2021 7:46 am

Thanks Carlitorweb,
Great tip.
Using Joomla since 2005


Post Reply

Return to “Joomla! 4.x Coding”