The WebIDE Blog

Features PhpStorm WebStorm

Mark file as plain text to exclude it from code completion and navigation

Sometimes you may want to exclude just a single file from the project so that code completion and navigation would not work for it. Examples include minified (compressed) PHP/JavaScript files which duplicate the code in other non-compressed files. It is possible now starting from the first PhpStorm/WebStorm 2.1 EAP build. There is a new “Mark as Plain Text” menu item in Project Tree context menu for files:

Once marked as plain text, the file is not used anymore for code completion and navigation and is shown as plain text with a special icon: 

You can mark the file with its original type using the same context menu at any time:

Thus, you have a full control of what files should be ignored by IDE’s language support. It may help solve the problems like the one described in WI-322 regarding Yii framework support, about yiilite.php file exclusion.

Of course you may find many other useful scenarios for this feature. Let us know what you think of it and how you use it.

Develop with pleasure!
-JetBrains Web IDE Team

Comments below can no longer be edited.

10 Responses to Mark file as plain text to exclude it from code completion and navigation

  1. Avatar

    Nils Luxton says:

    April 13, 2011

    Amazing. What an elegant solution to a problem that has plagued me for many years!

    I have to say I’m really impressed with this latest EAP; I’m continually impressed with the amount of functionality that gets added to PhpStorm – and by the speed that it gets added!

    Keep up the great work, guys!

  2. Avatar

    Sam Dark says:

    April 13, 2011

    Nice solution. Thanks.

  3. Avatar

    koubel says:

    April 20, 2011

    Nice, smart and helpful

  4. Avatar

    JMather says:

    June 28, 2011

    I don’t know if this will be seen but…

    Could we get this option to apply to an entire directory recursively?

    symfony has a lot of ‘template’ directories that cause issues…

    Or perhaps a way to flag one class as ‘this is the class you should always resolve to’ so that I could set my lib/form/BaseForm.class.php to always win out in a battle with other BaseForm classes.

  5. Avatar

    Daniel Shaw says:

    August 31, 2011

    In WebStorm, I have JavaScript file marked as plain text that I cannot revert. Right clicking provides no context menu to Mark as JavaScript. Suggestions?

    Daniel Shaw

    • Avatar

      rustam.vishnyakov says:

      November 14, 2011

      If this is the case, it’s definitely a bug and it would be good to report it at Attaching some screenshots and maybe steps to reproduce the problem would be helpful.
      As a workaround you can find .WebIde10/config/options directory, open plainTextFiles.xml and delete the line with the file in question. Make sure you take a backup copy first!

      • Avatar

        Matt says:

        December 12, 2011

        Hi rustam,

        I experienced the same issue by misclicking something in the ‘new’ context menu in the Project sidebar. ‘Mark as PHP’ and ‘Mark as plain text’ were both missing from the context menu.

        Cannot replicate, unfortunately, but was able to resolve by editing C:\Users\[username]\.WebIde10\config\options\filetypes.xml


  6. Avatar

    Dziamid says:

    November 14, 2011

    In symfony it is handly to mark cache/{appname}/prod/config_core_compile.php as plain text as it includes many classes in itself and mess up with the code completion.

  7. Avatar

    jlam says:

    March 6, 2012

    It’s not working for JS files. I accidentally marked it as plain text, but opening the context menu again it doesn’t have anything after “Delete” as it should’ve been.

    Webstorm 3.0.3 Any help appreciated!

  8. Avatar

    rustam.vishnyakov says:

    March 6, 2012

    I think it makes sense to submit an issue to with a screenshot of a context menu which you get for .js file marked as plain text. See also my reply above to Daniel for the quick workaround. Any steps to reproduce this issue would be definitely very helpful.

Discover more