所以,在我的代碼,我有以下情況結構上取代有一個參數名稱方法開始
view1.setBackgroundResource(R.drawable.is_bag);
view2.setBackgroundResource(R.drawable.is_bag);
view3.setBackgroundResource(R.color.red);
我試圖做一個結構性更換所有.setBackgroundResource(R.drawable.*
單獨的方法。這裏就是我想要什麼至今:
搜索模板:
$Instance$.setBackgroundResource($Parameter$)
編輯變量:
$Instance$ -> Text/regexp = <empty> (which i understand = .*)
$Parameter$ -> Text/regexp = .*R\.drawable\..*
Minimum count = 1 // Minimum one Foo parameter
Maximum count = 1 // Maximum one Foo parameter
出於某種原因,這種拒絕匹配任何。如果我將$Parameter$
更改爲空或.*
,則它匹配所有setBackgroundResource
方法。
會有人知道我在這裏做錯了嗎?
奇怪的一個,看起來$參數$的Text/regexp只適用於實際變量名稱(它包含靜態類型後的所有東西,即R.drawable)。如果將Text/regexp設置爲'is_bag',則會找到所有以'is_bag'結尾的文本。好奇......也許只是使用正則表達式搜索並替換爲這個。 –