# Setup VS Code for Kirby

**URL:** <https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 24, 2023, 5:33pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365 "2023-08-24T17:33:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardeisman](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@eduardeisman](https://forum.getkirby.com/u/eduardeisman)\
**Post date:** [August 24, 2023, 5:33pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365/1 "2023-08-24T17:33:49Z")

</div>

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.

> <https://github.com/getkirby/ideas/issues/189>
>
> just an idea. maybe find out and explain how to set this up? would make working …with kirby much easier.
> this might need some special markup in the core codebase as well (proper docBlocks).
> 
> \*\*popular editors\*\*
> \- sublime
> \- atom
> \- vs code
> \- php strom
> 
> \*\*further reading\*\*
> https://atom.io/packages/atom-autocomplete-php
> https://github.com/felixfbecker/php-language-server
> https://github.com/medienbaecker/vs-code-kirby-snippets
> 
> i will play around with some solutions for vs code and report back.

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

> **[PHP code typing with Kirby CMS](https://fvsch.com/kirby-typing)**
>
> Kirby 3 is built with PHP 7 and uses type annotations extensively, but this often won’t be reflected in an IDE. This post explores why, and what workarounds you can use.

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

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 24, 2023, 5:48pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365/2 "2023-08-24T17:48:46Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![eduardeisman](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@eduardeisman](https://forum.getkirby.com/u/eduardeisman)\
**Post date:** [August 24, 2023, 6:04pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365/3 "2023-08-24T18:04:02Z")

</div>

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

Thanks for clarifying!

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [August 24, 2023, 8:41pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365/4 "2023-08-24T20:41:42Z")

</div>

You might find this useful [GitHub - medienbaecker/vs-code-kirby-snippets: Kirby Cheatsheet for Visual Studio Code](https://github.com/medienbaecker/vs-code-kirby-snippets)

---

<div class="post-metadata">

**Author:** ![eduardeisman](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@eduardeisman](https://forum.getkirby.com/u/eduardeisman)\
**Post date:** [August 25, 2023, 4:06pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365/5 "2023-08-25T16:06:50Z")

</div>

Thats super helpful! Thank You!

---

<div class="post-metadata">

**Author:** ![eduardeisman](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@eduardeisman](https://forum.getkirby.com/u/eduardeisman)\
**Post date:** [September 8, 2023, 2:49pm UTC](https://forum.getkirby.com/t/setup-vs-code-for-kirby/29365/6 "2023-09-08T14:49:33Z")

</div>

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.
