PhpStorm 2018.3 Help

Creating and Registering File Types

If you're working with file types that are not recognized by PhpStorm (for example, if it's a proprietary file type developed in-house), or if you need to code in an unsupported language, you can create a custom file type.

You can configure how the IDE will parse the files by defining highlighting schemes for keywords, comments, numbers, and so on. You can also associate each file type with an extension to help the IDE identify the files of the custom formats.

Create a new file type

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), select Editor | File Types.

  2. In the Recognized File Types section, click the Add icon, specify the name of the new type, and provide a description.

  3. In the Syntax Highlighting section, configure case sensitivity, brace matching settings, and specify ways of defining comments:

    • Line comment – specify characters that indicate the beginning of a single-line comment.

    • Only at line start – characters that indicate the beginning of a line comment are recognized as a comment if they are located in the beginning of a line.

    • Block comment start, Block comment end – specify characters that indicate the beginning and the end of a block comment.

    • Hex prefix – specify characters that indicate that the subsequent value is a hexadecimal number (for example, 0x).

    • Number postfixes – specify characters that indicate which numeric system or unit is used. A postfix is a trailing string of characters (for example, e-3, kg).

    • Support paired braces, Support paired brackets, Support paired parens, Support string escapes – enable these checkboxes to highlight paired braces, brackets, parentheses, and string escapes.

  4. In the Keywords section, you can specify up to four lists of keywords. Keywords of each list will be highlighted differently in the editor and will be auto-completed.

  5. The Ignore case checkbox indicates whether the language in files of the custom format is case-sensitive.

Associate a file type with an extension

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), select Editor | File Types.

  2. From the Recognized File Types list, select the file type that you want to associate with an extension.

  3. In the Registered Patterns section, click the Add button, and specify the pattern that defines the file extension.

Ignore files and folders

In PhpStorm, there's a list of files and folders that are completely excluded from any kind of processing. Out of the box, this list includes temporary files, service files related to version control systems, and so on:

*.hprof;*.pyc;*.pyo;*.rbc;*.yarb;*~;.DS_Store;.git;.hg;.svn;CVS;__pycache__;_svn;vssver.scc;vssver2.scc;

Modify the list of ignored files and folders

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), select Editor | File Types.

  2. Make the necessary changes in the Ignore files and folders list. Make sure to use the semicolon (;) to separate the entries.

  3. Apply the changes and close the dialog.

Last modified: 14 December 2018

See Also