Code Style. XML
for Windows and Linux
for macOS
Ctrl+Alt+S
Use this page to configure formatting options for XML files. View the result in the Preview pane on the right.
On this page:
Tabs and Indents
Other
Item | Description |
---|---|
Right Margin | Use these settings to specify a margin space required on the right side of an element. If you select Default option then a value of the right margin from the global settings will be used. |
Wrap on typing | Use these settings settings to specify how the edited text is fitted in the specified Right margin. You can select one the following options:
|
Keep line breaks | Select this check box to have PhpStorm honor line breaks when reviewing XML files in the editor. |
Keep line breaks in text | Select this check box to have PhpStorm honor line breaks in attributes (for example, lengthy descriptions) when reviewing XML files in the editor. |
Keep blank lines | In this text box, specify the minimum number of sequential blank lines to be retained after reformatting. |
Wrap attributes | Use this drop-down list to determine how attribute lines should be wrapped. The available options are:
|
Wrap text | Select this check box to have long lines wrapped according to the code style settings. |
Align attributes | Select this check box to have attributes in sequential lines aligned. |
Keep white spaces | When this check box is selected, the editor preserves all whitespaces within tags. The same refers also to the indents, and line breaks. |
Spaces | In this area, define the usage of spaces for attributes and tag names. |
CDATA | In this area, define the usage of whitespaces around and inside CDATA sections in MXML files: |
Arrangement
This tab lets you define a set of rules that rearranges your code according to your preferences.
Item | Description |
---|---|
Matching rules | Use this area to define elements order as a list of rules, where every rule has a set of matches such as modifier or type.
|
Empty rule | Use this area to create a new matching rule or edit an existing one. You can select from the following filters:
|
This icon appears when you select Order by Name from the Order list. The icon indicates that the items in this rule are sorted alphabetically. | |
Additional Settings | Use this area to set additional arrangement options. The Force rearrange drop-down list lets you select options that affect the Rearrange entries check box in the Reformat Code dialog. You can select from the following options:
|
Set from
The link appears in the upper-right corner of the page, when applicable. Click this link and choose the language to be used as the base for the current language code style.
To return to the initial set of code style settings and discard the changes, click Reset.
Last modified: 28 November 2017