CPP-4184 Generate multiple '}' on enter for enclosed namespaces
authorAlexey Utkin <alexey.utkin@jetbrains.com>
Thu, 6 Aug 2015 17:11:13 +0000 (20:11 +0300)
committerAlexey Utkin <alexey.utkin@jetbrains.com>
Thu, 6 Aug 2015 17:11:13 +0000 (20:11 +0300)
platform/lang-impl/src/com/intellij/codeInsight/editorActions/enter/EnterAfterUnmatchedBraceHandler.java

index 279aa549b1a4669db446fcfefbd2b995f122aa05..5851654a396433abf0109c70ca798646c591fecd 100644 (file)
@@ -46,7 +46,7 @@ import com.intellij.util.text.CharArrayUtil;
 import org.jetbrains.annotations.NotNull;
 
 public class EnterAfterUnmatchedBraceHandler extends EnterHandlerDelegateAdapter {
-  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.editorActions.enter.EnterAfterUnmatchedBraceHandler");
+  protected static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.editorActions.enter.EnterAfterUnmatchedBraceHandler");
 
   @Override
   public Result preprocessEnter(@NotNull final PsiFile file, @NotNull final Editor editor, @NotNull final Ref<Integer> caretOffsetRef, @NotNull final Ref<Integer> caretAdvance,
@@ -114,7 +114,7 @@ public class EnterAfterUnmatchedBraceHandler extends EnterHandlerDelegateAdapter
       closingBraceIndentAdjusted = stamp != document.getModificationStamp();
       document.deleteString(caretOffset, caretOffset + 1);
     }
-    
+
     // There is a possible case that formatter was unable to adjust line indent for the closing brace (that is the case for plain text
     // document for example). Hence, we're trying to do the manually.
     if (!closingBraceIndentAdjusted) {
@@ -135,7 +135,7 @@ public class EnterAfterUnmatchedBraceHandler extends EnterHandlerDelegateAdapter
         document.insertString(offset + 1, buffer);
       }
     }
-    
+
     return Result.DefaultForceIndent;
   }
 
@@ -206,7 +206,7 @@ public class EnterAfterUnmatchedBraceHandler extends EnterHandlerDelegateAdapter
    *                  negative value if it's not possible to perform the calculation or if there are no unmatched left braces before
    *                  the given offset
    */
-  private static int getUnmatchedLBracesNumberBefore(Editor editor, int offset, FileType fileType) {
+  protected static int getUnmatchedLBracesNumberBefore(Editor editor, int offset, FileType fileType) {
     if (offset == 0) {
       return -1;
     }