Find/Replace 破坏了我的应用程序(鲁莽的错误)

Find/Replace broke my application (reckless mistake)

出于耐心,我做了一件你不应该做的事情,除非你绝对确定。我不是很确定,现在我要付钱了。

发生了什么

我过时的应用程序使用 fill_parent 作为 android:layout_height 的属性。 fill_parent 已弃用,因此我将所有内容切换为 match_parent。你大概能猜到接下来发生了什么...

我对 Android Studio 查找和替换工具很不满意。 Wreckless "undo" 是有限的。更糟糕的是,我又做了一次查找和替换来扭转这种情况,所以这是发生了什么:

问题

error: cannot find symbol variable fill_parent

我将 fill_parent 替换为 match_parent,然后加倍返回并将 match_parent 替换为 fill_parent 我最终替换了对fill_parent 甚至不再被识别的点。最坏的情况是我会复制我所在的位置,获取存储库中的先前版本,并找出所有更改的内容。有没有更省时的方法,还是我卡住了?

我拥有所有 Apple 产品,因为我们与他们合作最多,但我喜欢竞争 Google / Samsung / Microsoft 带来的竞争,总的来说我更喜欢竞争。话虽这么说,Apple 在这方面挽救了这一天。

时光机

自动备份是在“事故”发生前 10 分钟

如果你不熟悉,Time Machine is a product that Apple created to combat issues like the one I ran into today. Most consumers don't have the know-how of GIT / SVN so when they delete files they are permanently gone unless they have luck with a drive deep scanTime Machine 是一个很好的项目,如果您使用 OS X,那么我强烈建议您购买外置驱动器并将其作为 Time Machine 备份。