



The styles share most features, summed up in the following table, while they differ in a couple of details, explained in their own sections. Preferred code style described in previous sections, available values are PHP Tools, PSR-2, or others described below.ĭocument formatting is available in two versions that differ in the way they structure the document: PHP Tools, PSR-2. Number of spaces that represent a single tab, this value is used only when editor.insertSpaces is trueĮnables or disables automatic formatting of code block upon typing or }. Spaces are used to indent code if true, tabs are used otherwise. All the relevant settings and their effects are summed up in the following table. The formatting behavior is set in settings.json. It indents the code and pretty-prints spaces. This feature performs the selection formatting of the code preceding the type delimiter. Setting the option editor.formatOnType to true enables the editor to format code blocks and statements upon typing and }. The code formatting normalizes whitespaces, line endings, opening and closing braces, indentation and pretty print spaces. In order to format the document, it must be syntax-error free. Right-click the editor area and choose Format Document. The editor provides the document formatting feature for PHP documents.
