官术网_书友最值得收藏!

Excluding unwanted directories from the index

Did you try imagining why on earth PhpStorm has information about all the files you added in your project directory structure? How does PhpStorm detect the changes that you make to the disk by adding images, text files, and so on, and manages to show them in the Project view? Yes, the answer is indexing.

Getting ready

PhpStorm indexes everything that comes its way. Thus, it remembers the files and folders properly. But there is an overhead involved in this system. The more the number of files in the project, the longer the index created is. If PhpStorm decreases time in searching for files and folders by maintaining an index, how will it manage searching in the index itself when the index list has increased to a very large size?

How to do it...

You can help PhpStorm by performing the following steps:

  1. Go to Settings | Directories.
  2. Select a directory, and all you have to remember from here are three keyboard shortcuts: Alt + T, Alt + E, and Alt + R. Consider the following screenshots:
How to do it...

How it works…

Alt + T will mark a resource as a test resource, E will exclude it from indexing, and R will mark it as the content root. For you, the increase in speed will come from the magic key combination Alt + E. Be ruthless enough to apply this magic to all those directories that you decide are not important enough to be indexed.

Note

A test resource is a type of resource, most probably some PHP script, some directory, or some other file type that is used in the testing process. So, you can mark a resource as a test resource once you know that it will be useful for testing purposes.

PhpStorm, being a careful(ly written) piece of software, maintains a list of all the files that you save in your project, using indexes. So, a large number of files means a longer index and hence the potential danger of slowing PhpStorm down. An excluded resource is a resource—some file(s) or folder(s)— that you have asked PhpStorm not to index.

A content root is a folder or directory under which the contents of the resources you are working on is contained. You would easily be tempted to ask "what purpose does it serve?" The answer is rather simple: it maintains a clean workspace for you (everything in life need not be complicated)!

主站蜘蛛池模板: 景东| 开封市| 遂溪县| 大石桥市| 都昌县| 成武县| 清新县| 宜章县| 绥化市| 佛教| 莲花县| 昌图县| 渭源县| 大足县| 茶陵县| 桐城市| 班戈县| 五河县| 晋宁县| 尚志市| 襄垣县| 桂阳县| 库尔勒市| 太原市| 桂东县| 山丹县| 朝阳县| 安丘市| 拉萨市| 太原市| 长丰县| 长沙市| 高台县| 洱源县| 连山| 牡丹江市| 通许县| 老河口市| 通海县| 乌鲁木齐市| 海林市|