Walkero

software engineer, Drupal follower, Docker ninja, JS explorer, PHP believer, exotic Hardware beta tester, Amiga enthusiast, truth seeker, parent & husband... at least for now...

At my previous post I talked about VSCode and how you can change the way it works, by installing the extensions that you need, based on the way you prefer to work. I would like to propose you my 10+1 extensions that I mostly use.

  1. Project Manager by Alessandro Fragnani

I use to work on multiple projects at the same period, and a way to organise and switch between them as fast as I can is really mandatory for me. Project Manager helps to easily create different projects inside VSCode and switch between them from the dedicated sidebar. You can open a project directly to a new VSCode window, if you want to.

  1. VSNotes by Patrick Lee

VSNotes is a really simple tool that helps you keep notes for anything you want. I use it in conjunction with Project Manager and I keep notes per project. VSNotes uses Markdown files, and it has it's own sidebar which you can use to find the notes you are looking for.

You can use tags in those files, for organising them. You can set also a base path where these files will be saved. I usually set the .vscode/vsnotes folder inside each project and workspace. That method helps me find the notes that I am looking for really fast .

  1. Markdown All in One by Yu Zhang

Markdown is a lightweight markup language, and a simple way to format a text, with bold, italic, code block, headers and images. It is used in many websites, like the github.com, the tumblr.com and many others.

This extension will help you on creating your files in Markdown, as it has some helpful keyboard shortcuts for text formatting and a great preview feature, which updates itself as soon as you change the content. You can use it with VSNotes to view your notes.

  1. PHP Intelephense by Ben Mewburn

As a long time PHP developer, I use a few PHP extensions to help me on my day to day work. PHP Intelephense is one of my most used extensions, as it has features like a fast code completion, workspace wide go to definition and find all references of a method and many others. And everything work super-fast.

  1. phpcs by Ioannis Kappas

This extension works constantly at the background and uses the (PHP Codesniffer)[https://github.com/squizlabs/PHP_CodeSniffer], if it is available on your system. It helps you improve your code, by detecting violations of coding standards on your PHP, Javascript and CSS code. This way you can be sure that your code will remain clean and consistent.

Before you use this extension, you have to have phpcs installed and running on your system. The configuration is easy and the results can be viewed at the "Problems" bar at the bottom section.

  1. PHP Debug by Felix Becker

This extension uses the debug features of VSCode to provide debugging usability for PHP, based on xDebug. This way you can use breakpoint on specific lines, to pause PHP execution and check the values of variables, arrays, objects and the flow of the code execution. I really love the conditional breakpoints, were the code pauses only when the condition is fulfilled.

PHP Debug uses the sidebar to show all the information, as well as a popup over the variables, where you can quickly get the defined values. There is also a "Call Stack" section at the sidebar where you can see the methods/functions and the files that were called before your breakpoint and navigate to that code as well.

The configuration of this extension is easy and works well with remote and Docker containers.

  1. Better PHPUnit by calebporzio

If you write PHP code, using a modern framework, I am sure you use automatic testing, and maybe you are using PHPUnit, which is the most used method. Better PHPUnit helps execute the unit tests inside the VSCode window, for the whole suite or only the methods you work on.

Supports local running of PHPUnit, remotely through SSH and inside Docker containers, which is my favourite. The configuration might be a little bit tricky, but it works really good, as soon as you figure out how it works.

  1. GitLens bu Eric Amodio

VSCode supports and uses GIT excellent out of the box. GitLens gives you a lot more features, which are difficult to full cover here. The features I love most are the Code Lens, were you can get information on each line of the code of the last author, the commit where he last edited this line and the date. Also, at it's own sidebar you can find almost anything you want, like the local and remote branches, the available stashes and the used tags.

You can also get the file and line history as well as you can do some comparisons of your code with other branches or tags. There is a powerful search view where you can search and explore commit histories by message, author, files, id, etc..

This extension is huge and a must have, if you use GIT.

  1. Todo Tree by Gruntfuggly

Todo Tree is a simple extension that finds TODO tags inside your code and shows them at the sidebar. This is helpful for me when I start building a whole new feature, where first of all, I create TODO comments in the code, and then I know exactly what I have... em... to do, obviously. This way I help remind me the next steps and the results I expect from specific parts of the code.

Also, based on the available time, I create TODO comments for the code that needs to be done in the future. With that extension, things like that are not lost inside the project files.

The extension lets you create your own tags and set the colour that will be used. At the sidebar you have a lot of different ways to list used tags, like to show them all together, or in a tree view, based on the files and folders.

  1. EditorConfig for VS Code by EditorConfig

One more simple but must have extension, which attempts to override the workspace/user configuration and respect the .editorconfig rules on code format. This way you can be sure your code is consistent with your colleagues' code, as you write with the same indention, using the same tabs width, or using spaces. Don't miss this out when you work in a team.

  1. Better Comments by Aaron Bond

Better Comments is a useful extension, that helps you create more human-friendly comments in your code. You can stylize your comments, using own tags and colours for every single line. Also, it supports generic tags, like TODO or @param, and make them standout beautifully.

This list is in no way complete, but I hope will be useful, and find an extension that will make your development days a plessure.

#php #vscode #extensions #programming #phpunit
- 6 min read