File tree Expand file tree Collapse file tree
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -512,6 +512,7 @@ private ITypeBinding getPossibleSuperTypeBinding(ASTNode node) {
512512 @ Override
513513 public Object getAdditionalProposalInfo (IProgressMonitor monitor ) {
514514 StringBuilder buf = new StringBuilder ();
515+ boolean noSpacingNeeded = false ;
515516 switch (fTypeKind ) {
516517 case K_CLASS :
517518 buf .append (CorrectionMessages .NewCUCompletionUsingWizardProposal_createclass_info );
@@ -525,9 +526,14 @@ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
525526 case K_ANNOTATION :
526527 buf .append (CorrectionMessages .NewCUCompletionUsingWizardProposal_createannotation_info );
527528 break ;
529+ default :
530+ noSpacingNeeded = true ;
531+ }
532+ // #2183: newlines at the start of the preview String mess with the formatting
533+ if (!noSpacingNeeded ) {
534+ buf .append ("<br>" ); //$NON-NLS-1$
535+ buf .append ("<br>" ); //$NON-NLS-1$
528536 }
529- buf .append ("<br>" ); //$NON-NLS-1$
530- buf .append ("<br>" ); //$NON-NLS-1$
531537 if (fTypeContainer instanceof IType ) {
532538 buf .append (CorrectionMessages .NewCUCompletionUsingWizardProposal_tooltip_enclosingtype );
533539 } else {
You can’t perform that action at this time.
0 commit comments