Bug 5418 bracket marker stays in editor
private void showDebugSourcePage(String typeName) { if (dialog.open() == dialog.OK) { } 1. set the cursor after the opening bracket (after dialog.OK) 2. press enter 3. The bracket box includes all characters insterted by the auto indenter
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
ICompilationUnit unit= manager.getWorkingCopy(getEditorInput());
		
		if (unit != null) {
			synchronized (unit) {
				try {
					unit.reconcile();
					IJavaElement element= unit.getElementAt(position);
					if (element instanceof ISourceReference)
						return (ISourceReference) element;
				} catch (JavaModelException x) {
				}
			}
		}
		
		return null;
	}
	
	/*
	 * @see AbstractEditor#editorContextMenuAboutToChange
	 */
	public void editorContextMenuAboutToShow(IMenuManager menu) {
		super.editorContextMenuAboutToShow(menu);
		
		addAction(menu, IContextMenuConstants.GROUP_GENERATE, "ContentAssistProposal"); 
		addAction(menu, IContextMenuConstants.GROUP_GENERATE, "AddImportOnSelection"); 
		addAction(menu, IContextMenuConstants.GROUP_GENERATE, "OrganizeImports"); 
		addAction(menu, ITextEditorActionConstants.GROUP_ADD, "AddBreakpoint"); 
		addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); 
		addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Uncomment"); 
		addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Format");