10 comments
Comment actions Permalink

The diff viewer embeds a regular IntelliJ IDEA editor, which does not support inserting arbitrary content. Depending on what exactly you mean by "insert comments", this may be impossible to implement.

0
Comment actions Permalink

I am trying to add reviews from the diff viewer. How can I get track of the diff viewer. Say i need to add an mouselistner.

0
Comment actions Permalink

What UI exactly are you trying to implement?


0
Comment actions Permalink

Say i get the diff viewer of two files. Now i need to add a comment or annotation in the modified file. The final objective is to integrate with crucible review.

0
Comment actions Permalink

What UI exactly do you plan to use for adding the comment? This determines the APIs that you will need to use.

Note that Crucible review integration was supported in old versions of the Atlassian IntelliJ Connector plugin, which is open-source. Instead of writing a new plugin from scratch, it may be much more efficient to locate the existing Atlassian-developed code and to build it as a separate new plugin.

0
Comment actions Permalink

Thanks, I will check that out.
If my plugin needs to allow the user to click on the line from the diff viewer, which should open up a dialog box to record the comment. How should i proceed.

0
Comment actions Permalink

Clicking a line in a diff viewer already has an action assigned to it: it moves the caret to the click location. Please consider choosing a UI for your plugin that will not break the existing IntelliJ IDEA functionality.

0
Comment actions Permalink

How about comment option in the right click.
I need to know how to use the diff viewer by code.

0
Comment actions Permalink

As I said, the API is completely different depending on the UI that you want to implement. To make it available in the context menu, simply implement an action and add it to the EditorPopupMenu action group. In order to make the action only available in the diff viewer, use e.getData(PlatformDataKeys.DIFF_VIEWER) and hide the action if it returns null.

To find out what is being diffed, use e.getData(DiffDataKeys.DIFF_REQUEST) and check if the returned object is an instance of ContentDiffRequest.

0
Comment actions Permalink

You may also try to fork another Crucible plugin (https://github.com/ktisha/Crucible4IDEA), which was written against IDEA 13, and could possibly be easier to support IDEA 14 and improve further.

Let me also add that we have plans to introduce an API for review plugins, but there are no estimates on this.

0

Please sign in to leave a comment.