mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Deleted registry keys, minor refactoring
This commit is contained in:
+5
-11
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.psi.codeStyle.autodetect;
|
||||
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.Stack;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
@@ -36,7 +35,10 @@ class ContinuationIndentDetector {
|
||||
public void feedLineStartingAt(int startOffset) {
|
||||
if (myIncorrectBracketsOrder) return;
|
||||
|
||||
for (int i = startOffset; i < getLineEndOffset(startOffset); i++) {
|
||||
int lineEndOffset = CharArrayUtil.indexOf(myText, "\n", startOffset, myLength);
|
||||
if (lineEndOffset < 0) lineEndOffset = myLength;
|
||||
|
||||
for (int i = startOffset; i < lineEndOffset; i++) {
|
||||
Bracket bracket = Bracket.forChar(myText.charAt(i));
|
||||
if (bracket == null) continue;
|
||||
processBracket(bracket);
|
||||
@@ -58,20 +60,12 @@ class ContinuationIndentDetector {
|
||||
}
|
||||
|
||||
public boolean isContinuationIndent() {
|
||||
if (!shouldDetect() || myIncorrectBracketsOrder) {
|
||||
if (myIncorrectBracketsOrder) {
|
||||
return false;
|
||||
}
|
||||
return myOpenedBrackets.contains(Bracket.LPARENTH);
|
||||
}
|
||||
|
||||
private boolean shouldDetect() {
|
||||
return Registry.is("detect.indent.ignore.continuation.indented.lines");
|
||||
}
|
||||
|
||||
private int getLineEndOffset(int lineStartOffset) {
|
||||
int lineEndOffset = CharArrayUtil.indexOf(myText, "\n", lineStartOffset, myLength);
|
||||
return lineEndOffset < 0 ? myLength : lineEndOffset;
|
||||
}
|
||||
|
||||
private enum Bracket {
|
||||
LBRACE('{') {
|
||||
|
||||
@@ -535,9 +535,6 @@ editor.xcode.like.scrollbar.description=Enables auto-hideable Xcode-like editor
|
||||
editor.config.stop.at.project.root=true
|
||||
editor.config.stop.at.project.root.description=Stops searching for .editorconfig at project root (requires project reopening)
|
||||
|
||||
detect.indent.ignore.continuation.indented.lines=false
|
||||
detect.indent.ignore.continuation.indented.lines.description=When detecting file indent, ignore continuation indented lines
|
||||
|
||||
JDK8042508.bug.fixed=false
|
||||
JDK8042508.bug.fixed.description=Disable check for type variable until javac bug is fixed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user