How to display diff manager in order to compare two strings
Answered
I would like to open diff manager to compare two string. However I do not know how to do that properly, as the package names differ:
For example:
DiffManager.getInstance().showDiff(openedProjects[0], new SimpleDiffRequest("XXX", new SimpleContent("SSS"), new SimpleContent("DDD"), "AA", "FFF"));
This does not work as SimpleContent extends fromcom.intellij.openapi.diff and SimpleDiffRequest needs com.intellij.diff.contents. Is it a bug?Thanks.
Please sign in to leave a comment.
Hi,
There are two diff API in intellij atm. The old one (com.intellij.openapi.diff.*) and the new one (com.intellij.diff.* - IDEA 14.1+, builds 141.*+ ).
Using new API:
Using old API:
Is there a way to do this without coding and without creating a file? I want to open diff, copy string 1 on one side, the copy string 2 on other side, without needing to create a new scratch.
Probably, you're looking for "Open Blank Diff Window" action (https://www.jetbrains.com/help/idea/comparing-files-and-folders.html#compare-any-text-sources).