Setup VS Code for Kirby

Hey Everyone,

graphic designer, limited code knowledge here. Have worked with Grav and 11ty but never with Kirby (and PHP).

I’m trying to setup VS Code so it does the usual auto complete for writing code but can’t wrap my head around it. I’ve installed Intelephense but it doesn’t seem to be working.

I’ve found these two things that seem to go in the right direction but was wondering if I’m missing something more obvious.

There is a cookbook recipe mentioned in there but I can’t seem to find anything related.

I’ve been following the intro videos which are very useful and saw (Bastian?) using emmet in there with vs code.

Pointing me in any direction would be greatly appreciated,

Best,
EE

Code completion works out of the box with these extensions where the class can be derived from context.

This is not the case for variables like $page, $kirby etc. in templates and snippets, where we need to help the tools by adding type hints and annotations (like described in the article in your second link). So there is no way around some manual work…

Ah ok, good to know, I might have configured something wrong then.

Thanks for clarifying!

You might find this useful GitHub - medienbaecker/vs-code-kirby-snippets: Kirby Cheatsheet for Visual Studio Code

Thats super helpful! Thank You!

incase anybody else is running into this issue: if you start mamp before opening your project folder (I usually open my project folder first) VS Code seems to recognize the php executable path and Intelephense / intelesense seem to be working. I now get the auto-complete/suggestions I was looking for.

1 Like