- Code Composer Studio For Mac Catalina
- Code Composer Studio For Mac
- Code Composer Studio For Mac Windows 10
- Code Composer Studio For Mac Os
- Code Composer Studio For Mac Osx
Visual Studio Code is hot stuff right now and is quickly becoming the editor of choice for developers worldwide. It’s available for Mac, Windows and Linux and best of all it’s free.
Personally I was a little skeptical when I first learnt of Microsoft’s latest editor. I have been a long time user of Sublime Text, but VS Code has gradually won me over. The automation it offers with code completion as well as it’s superb git and debugging integration is a real winner. You can even trigger a terminal directly from within VS Code which is great for when you need to do something on the command-line without breaking out of the editor; I find this really helps with my workflow.
A few years ago I wrote about the Sublime Text plugins I considered essential for PHP developers. Now that I am increasingly choosing to load up VS Code instead I thought it was time to share my essential Visual Studio Code extensions for PHP developers. So here are my favourite extensions for improving productivity when writing PHP code.
Microsoft Bot Framework Composer. Bot Framework Composer is an open-source, visual authoring canvas for developers and multi-disciplinary teams to design and build conversational experiences with Language Understanding and QnA Maker, and a sophisticated composition of bot replies (Language Generation).
- I had the same issue on my Mac in Visual Studio Code (I used PEAR to install PHPCS). I do not know why but PHPCS couldn't find autoload.php of CodeSniffer. You can try to type on terminal command line: $ phpcs I got an error.
- Intel® Parallel Studio XE Users. Intel® oneAPI Base & HPC Toolkit delivers what developers need to build, analyze, optimize, and scale HPC applications. Intel® System Studio Users. Intel® oneAPI Base & IoT Toolkit delivers what you need to build, analyze, and optimize data-centric IoT applications and solutions that run at the network’s edge.
PHP Intelephense
This is the must have extension for PHP development and goes a long way to making Visual Studio Code feel more like a traditional IDE. PHP Intelephense will massively improve your efficiency by offering intelligent code completion, workspace wide definition support, parameter help for function calls and a whole lot more.
I’ve been using this extension for a while now and have been really impressed by what it offers. It is very rapid. At the time of writing it has an impressive 5 out of 5 rating. If you don’t install any other extension from this post, at least make sure you add this one to your editor.
PHP Mess Detector
This extension is a great way of monitoring your code and trying to keep it lean and bug free. PHP Mess Detector will analyse your code as you type and flag potential bugs and unused code. It will also help you identify overcomplicated expressions and suboptimal code. Unlike some of the following extensions there is no need to install anything extra as long as you have PHP installed, but you can easily customise the rules it runs. It also supports custom rules.
phpcs
Well written code should use a consistent coding standard, i.e. type of indentation, naming conventions, use of whitespace, bracket placement, etc.. Whatever standard you are working to, phpcs will help you to conform to them. To use this extension you’ll also need to ensure you’ve got PHP CodeSniffer installed; this can be easily done using Composer:-
If you work with more than one coding standard between projects then you’ll want to configure each workspace with the relevant standard. This is easily done by setting phpcs.standard
in your workspace’s settings.
PHP CS Fixer
So following on from phpcs, if we’re conforming to some coding standards it can also be useful to be able to quickly fix the formatting of code. That’s where PHP CS Fixer comes in handy. This provides a command that can be run to fix any breaches in standards which can also be switched on to automatically run on save. Like phpcs you will need to have PHP CS Fixer installed on your machine in addition to this Code extension.
EditorConfig
This next one may seem a little similar to phpcs, but seeing as many open source projects use this I feel it is well worth having installed too. EditorConfig provides a way of maintaining some coding style consistency between different editors and IDEs. This is particularly valuable when collaborating with others, some of whom may not be using Visual Studio Code to code with.
To use EditorConfig an .editorconfig file is placed in the root of a project and usually committed to the project’s repository so everyone working on it conforms to the rules. This is useful for defining tab styles and line endings among other things. Most editors have plugins available to support EditorConfig including Atom, PhpStorm, Sublime Text and now Visual Studio Code.
You can find out more about EditorConfig and what you can define in the .editorconfig file over on the official website. Details of the Visual Studio Code EditorConfig extension can be found on the Visual Studio Marketplace.
PHP DocBlocker
Good code should be well documented. PHPDoc is a pretty much universally accepted means of doing this in PHP; although many developers find documenting their code tedious. PHP DocBlocker simplifies the process of adding docblock comments by autocompleting /**
by pressing Enter or tab taking away some of the pain. This extension really helps by partially automating the process of documenting your functions.
Better PHPUnit
Code Composer Studio For Mac Catalina
I’m an advocate for testing code. I’ve spoken on the topic twice this year at user groups in Sheffield and Leeds, and written a blog on the topic of PHPUnit. So being able to run tests directly from within my editor is super useful. Better PHPUnit not only makes it easy to quickly run tests, but makes running specific tests as simple as placing the cursor within the test method.
If you unit test, then this is one for you.
PHP Debug
If you’re still debugging your code by adding die
statements here and there along with some var_dump
or print_r
calls, stop! Install XDebug and then grab this excellent extension for VS Code. PHP Debug will enable you to add breakpoints to your code so that you can pause the running of your app and investigate the variables currently set before proceeding to the next breakpoint. This all integrates nicely with VS Code’s built in debug mode.
Code Composer Studio For Mac
Breakpoints offer greater control of how you debug, without littering your codebase with debugging methods. Once you start debugging like this you will wonder how you put up with all those die
statements for so long.
GitLens
Visual Studio Code already comes with some great Git integration right out of the box, but GitLens takes it to the next level. This extension adds a lot of functionality to your editor with the aim of helping you gain a better insight into the history of your repositories. It adds a Git explorer for navigating your branches, some powerful comparison commands, inline git blame annotations and an easy to navigate file history panel among many other features.
GitLens is very customisable. It’s well worth loading up the extension’s settings after installing it as you may not want everything enabled to begin with. Personally I find the Code Lens a little distracting so disabled this early on.
Code Composer Studio For Mac Windows 10
After PHP Intelephense this is probably my next must have extension.
Markdown All in One
Code Composer Studio For Mac Os
As alluded to previously, documentation is an important part of dev work. It’s always a good idea to have a readme file in the root of each of your projects. Markdown has become a familiar standard for these files.
Code Composer Studio For Mac Osx
So my last essential VS Code extension for PHP developers is Markdown All in One. It provides some helpful keyboard shortcuts, a live preview and many more features to aid you when writing in Markdown. It even supports GitHub flavoured Markdown which is great for those open-source projects you are working on.