mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-100722 Commenting block of Java code with EOL comments unfolds imports and top comment
system property -> registry
This commit is contained in:
+5
-6
@@ -36,6 +36,7 @@ import com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -46,7 +47,6 @@ import com.intellij.psi.codeStyle.Indent;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
import com.intellij.util.DocumentUtil;
|
||||
import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.intellij.util.SystemProperties;
|
||||
import com.intellij.util.containers.IntArrayList;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import gnu.trove.THashMap;
|
||||
@@ -57,9 +57,6 @@ import java.util.Map;
|
||||
|
||||
public class CommentByLineCommentHandler implements CodeInsightActionHandler {
|
||||
|
||||
private static final int MIN_LINES_TO_COMMENT_TO_USE_BULK_PROCESSING
|
||||
= SystemProperties.getIntProperty("idea.bulk.comment.lines.trigger", 100);
|
||||
|
||||
private Project myProject;
|
||||
private PsiFile myFile;
|
||||
private Document myDocument;
|
||||
@@ -424,7 +421,8 @@ public class CommentByLineCommentHandler implements CodeInsightActionHandler {
|
||||
}
|
||||
|
||||
public void doDefaultCommenting(final Commenter commenter) {
|
||||
DocumentUtil.executeInBulk(myDocument, myEndLine - myStartLine >= MIN_LINES_TO_COMMENT_TO_USE_BULK_PROCESSING, new Runnable() {
|
||||
DocumentUtil.executeInBulk(
|
||||
myDocument, myEndLine - myStartLine >= Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int line = myEndLine; line >= myStartLine; line--) {
|
||||
@@ -440,7 +438,8 @@ public class CommentByLineCommentHandler implements CodeInsightActionHandler {
|
||||
final FileType fileType = myFile.getFileType();
|
||||
final Indent minIndent = computeMinIndent(myStartLine, myEndLine, chars, myCodeStyleManager, fileType);
|
||||
|
||||
DocumentUtil.executeInBulk(myDocument, myEndLine - myStartLine > MIN_LINES_TO_COMMENT_TO_USE_BULK_PROCESSING, new Runnable() {
|
||||
DocumentUtil.executeInBulk(
|
||||
myDocument, myEndLine - myStartLine > Registry.intValue("comment.by.line.bulk.lines.trigger"), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int line = myEndLine; line >= myStartLine; line--) {
|
||||
|
||||
@@ -271,3 +271,5 @@ diagrams.rendering.no.cache=true
|
||||
wolf.the.problem.solver=true
|
||||
ui.no.bangs.and.whistles=false
|
||||
disable.graph.inference=false
|
||||
|
||||
comment.by.line.bulk.lines.trigger=100
|
||||
Reference in New Issue
Block a user