PHP Code Completion in WebMatrix 2 Beta
Are you a PHP developer? We love PHP, too. We asked PHP developers like you which development tasks were most time-consuming. Here's what they said:
- You suspect that there's a built-in PHP function to do what you want, but you don't know the exact name.
- You search the PHP.net site--they have some top-notch documentation!
- You find the function, return to the editor, and type the function.
- Repeat for the next function you don't quite remember.
In this article, we discuss what’s new to address these issues and speed up PHP development.
In This Article
Code Completion for PHP (top)
Many development tools have a feature called "code completion" (we call it IntelliSense) where the editor suggests appropriate functions or keywords as you type. We're adding this feature for PHP in WebMatrix 2, so that the entire PHP function library (which is installed when you enable PHP in WebMatrix) is at your fingertips while you code. Check it out:
Now when you're hunting for that function, just start typing and you'll see it, along with a brief description so you know it's the one you want. Our goal: we save you many trips to the PHP site for documentation.
Quick Info for Instant Documentation (top)
When you're browsing other people's code (or even code that you wrote a long time ago), you might not recognize some of the functions or constructs you see. Now you can get a refresher about any element without leaving WebMatrix. Hold the mouse pointer over an element, and WebMatrix gets information about the element from the same documentation source (PHP.net) and displays it:
You can click the link to jump straight to the documentation on PHP.net. This is called Quick Info, and we think it will make searching for reference pages a thing of the past.
Code Completion for Applications (top)
If you like to work with web applications like WordPress and build themes or plugins on top of them, you'll love this. If your favorite application supports it, you can get application-specific code completion while you type, just like for the built-in PHP functions! Here's an example using WordPress:
Quick Info support is there when you hold your mouse pointer over code, too:
This feature depends on the application owner adding this support to the application package in the Web App Gallery. Let app authors know if you want Quick Info for your favorite app!
If you want to see fewer (or more) items in IntelliSense and Quick Info, you can. All the entries and their descriptions are in a schema file that's located in the WebMatrix program directory:
64-bit machine: C:\Program Files (x86)\Microsoft WebMatrix\Schemas\Php\PHP53Schema.xml
32-bit machine: C:\Program Files\Microsoft WebMatrix\Schemas\Php\PHP53Schema.xml
We hope that these features help you build PHP sites faster and with less context switching. Want more PHP love? We're listening.
Learn More about WebMatrix 2 Beta
If you want to learn more about other great features in WebMatrix 2 Beta, check out some of these articles: