Setting Up Tools for My IDEs (VSCode and PHPStorm)

In the recent weeks, I’ve worked on a few issues, and I found out that I can improve tons of time if I can give my IDEs more lovely tools!

  • WordPress assistance
  • From IDEs to GitHub links
  • Set up xDebug for Lavarel Valet + PHPStorm

I am using two main IDEs: Visual Studio Code (VSCode) and PHPStorm.

  • VSCode for quick and remote debugging. In addition, it’s very light.
  • PHPStorm for in-depth debugging or coding. Though PHPStorm is very heavy each time it loads, it’s super convenient when I need to work on complicated codebase. It’s like everything is ready to support your productivity.

WordPress assistance

I tried these guides again to set up WordPress specific assistance for PHPStorm. I could achieve most of things this time (by patiently following up their guide again), especially the hooks support and WP CLI:

  1. https://www.jetbrains.com/help/phpstorm/wordpress-aware-coding-assistance.html#hooks-support
  2. https://www.jetbrains.com/help/phpstorm/using-the-wordpress-command-line-tool-wp-cli.html#configuring-wp-cli

As you might know, it’s super nice that PHPStorm can detect and support hooks.

For VSCode, I am using this tool https://marketplace.visualstudio.com/items?itemName=wordpresstoolbox.wordpress-toolbox. It’s not as nice as PHPStorm is, however, it’s good enough to give me some auto suggestions regarding WordPress functions and hooks.

From IDEs to GitHub links

To explain PRs or debugging steps, I have recently grabbed a lot of line references in GitHub. It’s tedious and takes time to search in GitHub repos, find correct files, and choose correct lines.

In searching of a way to quickly open the current line from my IDE in a GitHub repo as recently I could find out this extension for VSCode:

Similarly, I got the same extension for PHPStorm. It works super nice!!!

Set up xDebug for Lavarel Valet + PHPStorm

I spent so much time for trial-and-error steps to debug this issue. It would have been shorter if I could trace the values of each function and step with xDebug. My motivation is to reduce the time to troubleshoot the issue and get faster to the solution.

These are good guides to follow:

Note for setting up PHPStorm in my case:

  • Preferences (Command + ,) > Languages & Frameworks > PHP > Debug: I found out “Validate” option is quite useful.
  • Preferences (Command + ,) > Languages & Frameworks > PHP > Debug > DBGProxy:
    • IDE key: PHPSTORM
    • Host: 127.0.0.1 [it had not worked until I added this value]
    • Port: 9001

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s