Crane - A PHP plugin for VS Code

2019 Update: Crane has been retired after 3 years of life. It achieved more than I ever dreamed of and I’m immensely grateful to all 250,000 of you who installed the plugin. Hopefully it was useful to you. Read more here

VS Code is an amazingly extensible, cross-platform code editor based on Electron.

It’s currently in beta and undergoing heavy development by a team within Microsoft, who have open-sourced the project and are on a rolling monthly release cycle.

It has support for a huge number of programming languages, and that number is growing as the community writes extensions to give full or partial support for even more languages on a daily basis.

Today I’m pleased to announce the first VS Code extension that provides PHP code-completion.

It’s called Crane, and I’ve released it with the source code under the MIT licence on my company GitHub page. It’s also available on the VS Code marketplace.

Crane is semi-intelligent and the code-completion engine currently provides code-completion suggestions for as many code features as it can, including functions, variables, constants, traits, classes, properties, methods, interfaces, parameters and namespaces.

This is the first public release, and while it has been tested internally, PHP is an “interesting” language in terms of its grammar so it is highly likely that there is code that the code-completion simply doesn’t work for.

If you encounter a situation like this, please report any bugs that you find so we can fix them as quickly as possible!

Crane makes uses of the JavaScript php-parser library written by Ioan Chiriac.

Without this parser, Crane would not have been possible, so thanks Ioan!