IntelliJ structural search and replace problems

别说谁变了你拦得住时间么 提交于 2019-12-06 14:00:13
nicity

SSR matches one or many language constructions per variable, it will NOT capture several variables ($mapType$$mapEnd$) into type reference (or whatever language lexem is). For code like

List<String> someName = new ArrayList<String>();

one needs to have search pattern

List<$Type$> $variable$ = new $ListType$<$Type$>()

and replace it accordingly. For more complex generic expressions one needs to consider several generic type variables like Map<$Key$, $Value$> One might find this article useful (many concrete SSR example patterns)

http://www.jetbrains.com/idea/documentation/ssr.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!