如何找到某个方法的声明

 

 (文章是从我的个人主页上粘贴过来的,大家也可以访问我的主页 www.iwangzheng.com)

 

1. 在VIM中,输入:    :Gsearch -F '要搜索的东西' -R --include=*rb --include=*js
2. 就会得到:(可以看到,最下面的绿色地方,就是JS的声明)
1 #
2 # Modify the contents of this buffer and then
3 # use the ":Greplace" command to merge the changes.
4 #

5 app/views/client/version_ups/_form.html.erb:149:  validate_form( 'form', {
...

...
15 app/views/layouts/_customized_coffeescript.html.erb:118:@validate_form = (form_selector, options) ->

只有15那一条变量前面是加了@符号的,所以就可以直接回车查看了,那个文件就是方法声明的地方。

posted @ 2014-03-03 11:17  冰凌花花~  阅读(165)  评论(0编辑  收藏  举报