This page last changed on Mar 15, 2010 by alui.

Once you have set up your Crucible server as an Eclipse task repository, you can perform a Crucible review without leaving Eclipse. The Atlassian Connector for Eclipse allows you to create and manage comments in a special Eclipse editor that contains the review, or directly in the Eclipse code editor. We describe both methods below. You can also manage your review comments in the diff view, as described in another topic.

Can't see or add comments in your code editor?
If you want to work with your Crucible review in the Eclipse code editor, the review task must be active in Mylyn Eclipse. See below for instructions.

Tip: Wiki markup is supported for review comments in the Atlassian Connector for Eclipse.
Tip: You can also view and work with review comments in the Crucible Review Perspective.

On this page:

Managing Comments in the Review Editor

You can open your Crucible review in a special Eclipse editor and add, reply to or update review comments within the editor view.

To manage your comments in the review editor,

  1. If you have not already done so, define your Crucible filters as described in the guide to creating a query.
  2. Open the review in an Eclipse editor:
    • Open your Eclipse 'Task List' view: In the Eclipse toolbar, select 'Window', 'Show View', 'Task List'.
    • Open the folder with the name corresponding to the query that you want, i.e. the Crucible filter that you created earlier.
    • Double-click the line showing the review you want, or right-click the line and select 'Open'.
  3. The review details appear in an Eclipse editor. Now you can conduct your review in the Eclipse editor, by adding and responding to review comments as shown in diagram 1 below:
    • Add, edit, delete and reply to comments applicable to the review as a whole. These are called 'general review comments'.
    • Add, edit, delete and reply to comments applicable to a file. These are called 'general file comments'.
    • Edit, delete and reply to comments applicable to a line or block of source code. These are called 'line comments'.
      To add a line comment, you need to open the source file in the Eclipse editor. See below. You cannot add line comments from the review details editor.
    • Open the file under review, at the commented source code line. This will open the file in the Eclipse code editor, so that you can manage your comments there as described below.
Working with code and review side by side
This is a handy way to work with the comments in the review editor while viewing the commented code in another open window: Open the source file in your code editor and the Crucible review in the review editor, with the two editor windows side by side. Click the text of a line comment in the review editor. The corresponding code lines will be highlighted in the code editor. You may find this easier than reading the code and hovering over the Crucible icon to see the comment.


Diagram 1: Managing your review comments in the review editor

Viewing Comments in the Code Editor

When working with your code in an Eclipse editor, you can see the Crucible review comments as well. See diagram 2 below.

  • Review comments are annotated with the Crucible icon in the left-hand ruler of the Eclipse editor.
    • Hover over the Crucible icon to see the comment text and other details of the review comment.
    • Press F2 when viewing the comment details to bring the comment into focus, so that you can update or reply to the comment. See below for more details on how to conduct the review.
  • The code lines to which the comment applies are highlighted in the editor body.
  • An annotation at the top of the right-hand ruler shows, on hover, how many active review comments there are for the file.
  • Annotations in the right-hand ruler show every line comment in the entire file, including the code sections that are not currently visible in your window.
    • Click an annotation to jump to the commented code line.
    • Hover over an annotation to see a tooltip containing the comment text.


Diagram 2: Viewing the review comments in the code editor

Adding, Updating and Replying to Comments in the Code Editor

When viewing the source code in an Eclipse editor, you can:

  • Add general file comments.
  • Add, reply to and update line comments.

To add comments in the code editor,

  1. Make sure that the Crucible review task is active in Mylyn Eclipse. To activate the Mylyn task, you can do one of the following:
    • Open the review in its own Eclipse view, as described above.
    • Or right-click the review in your Eclipse Mylyn task list and select 'Activate'.
  2. Select a code line or a block of lines in the Eclipse code editor and right-click.
  3. Select either 'Add General File Comment' or 'Comment on Selected Lines'. In diagram 3 below, we show you how to add a line comment.
  4. A popup window will ask you for the comment details. Enter the comment text, supply the other information if necessary, and 'Post' the comment.


Diagram 3: Adding review comments in the code editor

Review comments are annotated with the Crucible icon in the left-hand ruler of the Eclipse editor. Also, annotations in the right-hand ruler show every line comment in the entire file, including the code sections that are not currently visible in your window. See above for more details about viewing comments in the code editor.

To reply to and update line comments in the code editor,

  1. Make sure that the Crucible review task is active in Mylyn Eclipse. To activate the Mylyn task, you can do one of the following:
    • Open the review in its own Eclipse view, as described above.
    • Or right-click the review in your Eclipse Mylyn task list and select 'Activate'.
  2. Find the comment that you want to reply to or update in the code editor:
    • Hover over the annotations in the right-hand ruler to see a tooltip containing the comment text.
    • Click the annotation in the right-hand ruler to jump to the comment you want.
  3. Open the comment for editing or replying:
    • Hover over the Crucible icon in the left-hand ruler to see the comment text.
    • Press F2 when viewing the comment details to bring the comment into focus.
  4. The review comment box becomes an inline dialogue box. Now you can reply to the comment, edit it or delete it, depending on your permissions, as shown in diagram 4 below. You can also choose to open the review in the Eclipse review editor instead. See above for instructions on managing comments in the review editor.


Diagram 4: Replying to and updating line comments in the code editor

Next, take a look at working on a review in the diff view.

RELATED TOPICS

Working with Crucible Reviews in Eclipse

Refer to the Crucible documentation for more information about Crucible reviews.


Managing comments in review editor (application/octet-stream)
Managing comments in review editor (application/octet-stream)
Managing comments in review editor (application/octet-stream)
Managing comments in review editor (application/octet-stream)
Managing comments in review editor (application/octet-stream)
Viewing comments in code editor (text/xml)
CrucibleViewComments.jpg (image/jpeg)
Viewing comments in code editor (application/octet-stream)
Viewing comments in code editor (application/octet-stream)
Viewing comments in code editor (application/octet-stream)
Adding comments in code editor (application/octet-stream)
CrucibleAddCommentInCodeEditor.jpg (image/jpeg)
CrucibleAddLineComment.jpg (image/jpeg)
Updating comments in code editor (text/xml)
Adding comments in code editor (application/octet-stream)
Managing comments in review editor (application/octet-stream)
Adding comments in code editor (application/octet-stream)
Updating comments in code editor (application/octet-stream)
CrucibleUpdateCommentInCodeEditor.jpg (image/jpeg)
Updating comments in code editor (application/octet-stream)
Updating comments in code editor (application/octet-stream)
Managing comments in review editor (application/octet-stream)
Document generated by Confluence on Mar 17, 2010 21:17