General

How to get intellisense when developing a Grav theme or plugin?

Many IDEs such as Visual Studio Code have built-in or third-party plugins to auto-complete code and hint errors. However, if you're working on your plugin or theme directly on their respective folders, your IDE won't know where are the classes you're referring in your code and will give you constant errors.

To fix this, you can add Grav as a dependency using composer require getgrav/grav --dev.

The parameter --dev is very important, since it tells Composer to install Grav as an optional dependency.

When building for production, you should do composer install --no-dev.