For the most part the ability to provide your own CommitSession implementation
in a plugin works well. However I have a couple of questions/problems:
- if I return null from CommitSession.getAdditionalConfigurationUI() IDEA
barfs with a NullPointerException. If I return a JComponent, IDEA displays
an additional dialog containing that component. I think returning null should
just silently prevent that dialog from being shown (I don't want this dialog
to appear). Is this a bug?
- what is the correct way to find the differences between revisions for a
given Change object in the execute() method? getBeforeRevision().getFile().getDocument()
and getAfterRevision().getFile().getDocument() both return the same (current)
version of the document. getBeforeRevision().getContent() and getAfterRevision().getContent()
work, however they're both just returned as a String so to pass the individual
lines of text into Diff.buildChanges(beforeLines, afterLines) I have to parse
out all the linefeeds first. Also, getContent() seems to retrieve the revision
from the codestore. What I'd really like is access to whatever it is IDEA
uses to color-code the left hand margin to indicate which lines have been
changed/inserted/deleted for each open file. Obviously the information already
exists somewhere, I just can't see a way to access it.
Any comments/tips appreciated!