在视觉上区分自动生成的文件? [英] Visually distinguish auto-generated files?

查看:72
本文介绍了在视觉上区分自动生成的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一堆文件是根据数据库模型自动生成的.我有一些facepalm体验,是因为我修改了一些代码,却发现我的修改被覆盖了,因为我没有注意到我的更改是在那些生成的文件中.

We have a bunch of files that are auto-generated based on the database model. I have had some facepalm experiences because I modified some code, only to find out my modifications where overwritten because I'd not noticed that my changes were in those generated files.

因此,我修改了生成器,以在文件头中包含请勿修改"注释.这有帮助!虽然,当跟踪方法调用时,很容易最终出现在这些文件之一的中间,并且除非滚动到顶部以检查标题,否则您不一定会知道.这很尴尬(而且容易出错).

So, I modified our generator to include a "do not modify" comment in the file header. This helps! Although, when tracing method calls, it's easy to end up in the middle of one of these files, and you wouldn't necessarily know unless you scrolled to the top to check for the header. That is awkward (and error-prone).

是否有任何方法可以标记这些文件,就像标记外部库"一样,因此从样式上很明显,这些文件应该是只读的?

Is there any way to mark these files, in a similar way that "External Libraries" are marked, so it's clear from styling that these files should be read-only?

(我最初是在软件工程学中问这个的,但是要我移动它.)

(I originally asked this in Software Engineering, but gnat asked me to move it.)

推荐答案

从PhpStorm端,您可以使用 Scopes File Colors 功能.

From PhpStorm side you can use Scopes and File Colors functionality.

  1. 创建自定义范围,其中仅列出此类内容文件(如果此类文件位于特定文件夹中或文件名中具有某些唯一部分,则将更容易.否则,您将不得不指向单个文件).

  1. Create custom Scope that would list only such files (will be easier if such files are located in specific folders or have some unique part in file name .. otherwise you will have to point to individual files).

使用文件颜色功能(添加您的示波器)并分配唯一的颜色.

Use File Colors functionality (add your Scope there) and assign unique color.

现在,此类文件将具有该颜色作为编辑器标签的背景(不是编辑器本身,而是编辑器标签)以及项目视图/不同搜索中的背景以及其他与文件相关的弹出式窗口(可选;可以可以打开/关闭,但它将对所有示波器都执行此操作.

Now such files will have that color as editor tab background (not editor itself, just editor tab) as well as background in Project View/different search and other file-related popups (optional; can be turned on/off but it will do that for ALL scopes).

整个过程/想法甚至都有自己的帮助页面: https://www.jetbrains.com/help/phpstorm/2016.3/configuring-scopes-and-file-colors.html?search=scope

This whole procedure/idea has even got own help page: https://www.jetbrains.com/help/phpstorm/2016.3/configuring-scopes-and-file-colors.html?search=scope

这篇关于在视觉上区分自动生成的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆