News for hackers. Stuff that matters.
Re:Things You Should Never Do, Part I (2000) by scrabble on Wednesday September 04, 2013 @12:15PM (#6328549)
I don't know about other IDEs, but in Visual Studio I'm able to just right-click on a method and hit "Find All References" to see a list of everywhere something is called.
Re:Things You Should Never Do, Part I (2000) by quantumstate on Wednesday September 04, 2013 @12:46PM (#6328763)
I work on a large piece of C++ software (millions of lines) and unfortunately this feature does not work well enough to be worth using. The first problem is that it takes far too long, much longer than the rename method and waiting to recompile. The other pretty serious problem is that it sometimes misses references so I just can't trust it.
Re:Things You Should Never Do, Part I (2000) by moron4hire on Wednesday September 04, 2013 @03:00PM (#6329662)
While that is true, and I do use it frequently (so much so that I prefer the keyboard shortcut CTRL+K, CTRL+R), it's not available everywhere. Also, I tend to still use the "break-it" pattern in Visual Studio because the errors serve as a good TODO list to clean up all of the references.

Though, it gets a little more complicated when dealing with overloaded methods. In that case, Find All References really is a lot better.

Re:Things You Should Never Do, Part I (2000) by dllthomas on Wednesday September 04, 2013 @02:22PM (#6329381)
In my vim setup, ctrl-\ <Tab> drops a search for the word my cursor is sitting on (with word boundaries) in my quickfix buffer, for easy stepping through. More or less the same thing.
Re:Things You Should Never Do, Part I (2000) by agscala on Wednesday September 04, 2013 @03:47PM (#6329972)
Could you paste your config for doing this? I'd like to give it a try.
Re:Things You Should Never Do, Part I (2000) by dllthomas on Wednesday September 04, 2013 @04:33PM (#6330280)
The actual vim config is terribly simple:

    nmap <silent> <Leader><Tab> :make search PATTERN='\<^R^W\>'<Cr>
Where ^R and ^W are literal ctrl-R and ctrl-W (typed with a leading ctrl-v).

Then my Makefile contains:

    search:
        git grep -n "$$PATTERN"
plus some project-specific bits to prune out portions of the tree which should be skipped.

The following are also nice:

    clip:           
        xclip -o        
                    
    todo:           
        PATTERN=TO''DO make search | sed -n 's/\([^ \t]*\)\(.*TO''DO \(([0-9]*)\)\):\?\(.*\)/\1 \3 \2\4/p' | sort -k 2                  

I've also found it useful to make sure my unit tests output some relevant file:line: info and run those from my makefile.

Relatedly, I have:

    nmap <silent> <Tab> :cnext<Cr>
    nmap <silent> <S-Tab> :cprev<Cr>
to make it easy to jump between quick-fix items.