views:

146

answers:

3

EDIT: Primarily, talking about code written in C.

Someone sends me a diff to review and I know I can take the "before" code, apply the diff (patch) to get proposed "after" code, and open both, pair of files by pair of files, in a difference viewer (e.g. WinMerge, Araxis Merge, etc.) to review the change.

On the other hand, if I want to stay in my preferred code browser, with syntax highlighting and right-click definitions, then I don't have the diff anymore.

For prose reviewers, MS-Word, which is like a prose writer's IDE, allows you to point a currently-open file at another version of that file, tell it "compare", and, instead of giving you two windows, it highlights the changes on the version you've got open.

Anyone know of an IDE that does that for code?

EDIT: In other words, an IDE with a built-in diff viewer? Or which allows plug-in of an existing great standalone one?

(I bet I could hack an IDE-based code review add-in like Jupiter for Eclipse to do it; lying to it and pretending that the patch is a set of code review comments. But I don't want to lie. I want a source code editor that already think that "compare" is an IDE function.)

A: 

IntelliJ IDEA lets you review the changes in a patch before actually applying them. The affected files are listed in an explorer-type window. For each file, you can see the before and after side-by-side with the changes highlighted.

jackrabbit
Will IntelliJ IDEA handle C code well?
talkaboutquality
There was a plugin for handling C code. I haven't really used it, but it looked nice from afar. The merging capability should not be affected I guess. Note that there now is a free Community Edition of IDEA, but I don't know if the plugin works with that. I'll check that out later today.
jackrabbit
jackrabbit
+2  A: 

NetBean's built-in diff viewer will indeed open both versions, not just keep the one you have open and show differences.

But you're still in your IDE, with the syntax highligh and right click definitions and everything. In fact, you can minimize the size of the other file, so you get in effect what you're describing.

Here's what it looks like (on the right you can see the code completion window):

alt text

JRL
Will NetBean handle C code well?
talkaboutquality
@Tom: I don't know, never used it for doing C.
JRL
A: 

I am using jEdit with the JDiffPlugin. Here's what the plugin says:

Author: Dale Anson, Andre Kaplan Released: 20 May 2009 JDiffPlugin is a visual diff utility for jEdit that shows and highlights side-by-side differences between two files.

See screenshot below. The colors are freely configurable.

alt text

nalply
A note to self: jEdit is not an IDE per se, but a powerful editor with many capabilities of an IDE.
nalply