Skip to content

Commit c356bb2

Browse files
committed
Deleted the indented override method and corrected the variable name and comment.
1 parent 7e63b7e commit c356bb2

15 files changed

+9
-84
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/CommonPathParameter.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import org.jetbrains.jps.model.java.JavaResourceRootType
2222
import org.jetbrains.jps.model.java.JavaSourceRootType
2323
import java.util.concurrent.ConcurrentHashMap
2424

25-
val RESOURCES_META_INF_PATH: String
26-
get() = "META-INF"
25+
const val RESOURCES_META_INF_PATH: String = "META-INF"
2726

2827
/**
2928
* A utility for caching directory information on a per-module basis.

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/SqlOtherBlock.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ open class SqlOtherBlock(
4242
override fun setParentGroupBlock(lastGroup: SqlBlock?) {
4343
super.setParentGroupBlock(lastGroup)
4444
indent.indentLevel = IndentType.NONE
45-
indent.indentLen = createIndentLen()
45+
indent.indentLen = 1
4646
indent.groupIndentLen = 0
4747
}
4848

4949
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
5050

51-
private fun createIndentLen(): Int = 1
52-
5351
override fun isLeaf(): Boolean = true
5452
}

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/SqlWhitespaceBlock.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package org.domaframework.doma.intellij.formatter.block
1818
import com.intellij.formatting.Alignment
1919
import com.intellij.formatting.Block
2020
import com.intellij.formatting.FormattingMode
21-
import com.intellij.formatting.Indent
2221
import com.intellij.formatting.Spacing
2322
import com.intellij.formatting.SpacingBuilder
2423
import com.intellij.formatting.Wrap
@@ -42,8 +41,6 @@ class SqlWhitespaceBlock(
4241
) {
4342
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
4443

45-
override fun getIndent(): Indent? = Indent.getNoneIndent()
46-
4744
override fun isLeaf(): Boolean = true
4845

4946
override fun getSpacing(

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/SqlInlineGroupBlock.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.domaframework.doma.intellij.formatter.block.group.keyword
1717

18-
import com.intellij.formatting.Indent
1918
import com.intellij.lang.ASTNode
2019
import com.intellij.psi.formatter.common.AbstractBlock
2120
import org.domaframework.doma.intellij.formatter.block.SqlBlock
@@ -46,13 +45,6 @@ open class SqlInlineGroupBlock(
4645

4746
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
4847

49-
override fun getIndent(): Indent? {
50-
if (!isAdjustIndentOnEnter() && parentBlock?.indent?.indentLevel == IndentType.SUB) {
51-
return Indent.getSpaceIndent(0)
52-
}
53-
return Indent.getNoneIndent()
54-
}
55-
5648
override fun createBlockIndentLen(): Int =
5749
parentBlock?.let {
5850
it.indent.groupIndentLen

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/SqlInlineSecondGroupBlock.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.domaframework.doma.intellij.formatter.block.group.keyword
1717

18-
import com.intellij.formatting.Indent
1918
import com.intellij.lang.ASTNode
2019
import com.intellij.psi.formatter.common.AbstractBlock
2120
import org.domaframework.doma.intellij.formatter.block.SqlBlock
@@ -48,13 +47,6 @@ open class SqlInlineSecondGroupBlock(
4847

4948
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
5049

51-
override fun getIndent(): Indent? =
52-
if (isAdjustIndentOnEnter()) {
53-
null
54-
} else {
55-
Indent.getSpaceIndent(indent.indentLen)
56-
}
57-
5850
override fun createBlockIndentLen(): Int =
5951
parentBlock?.let {
6052
// TODO:Customize indentation within an inline group

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/SqlJoinGroupBlock.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.domaframework.doma.intellij.formatter.block.group.keyword
1717

18-
import com.intellij.formatting.Indent
1918
import com.intellij.lang.ASTNode
2019
import com.intellij.psi.formatter.common.AbstractBlock
2120
import org.domaframework.doma.intellij.formatter.block.SqlBlock
@@ -47,14 +46,7 @@ open class SqlJoinGroupBlock(
4746

4847
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
4948

50-
override fun getIndent(): Indent? =
51-
if (isAdjustIndentOnEnter()) {
52-
null
53-
} else {
54-
Indent.getSpaceIndent(indent.indentLen)
55-
}
56-
57-
override fun createBlockIndentLen(preChildBlock: SqlBlock?): Int =
49+
override fun createBlockIndentLen(): Int =
5850
parentBlock
5951
?.indent
6052
?.groupIndentLen

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/SqlKeywordGroupBlock.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.domaframework.doma.intellij.formatter.block.group.keyword
1717

18-
import com.intellij.formatting.Indent
1918
import com.intellij.lang.ASTNode
2019
import com.intellij.psi.formatter.common.AbstractBlock
2120
import org.domaframework.doma.intellij.common.util.TypeUtil
@@ -113,13 +112,6 @@ open class SqlKeywordGroupBlock(
113112

114113
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
115114

116-
override fun getIndent(): Indent? {
117-
if (!isAdjustIndentOnEnter() && parentBlock?.indent?.indentLevel == IndentType.SUB) {
118-
return Indent.getSpaceIndent(0)
119-
}
120-
return Indent.getNoneIndent()
121-
}
122-
123115
/**
124116
* Adjust the indent position of the subgroup block element itself if it has a comment
125117
*/

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/condition/SqlConditionKeywordGroupBlock.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.domaframework.doma.intellij.formatter.block.group.subgroup.SqlSubGrou
2222
import org.domaframework.doma.intellij.formatter.util.SqlBlockFormattingContext
2323

2424
/**
25-
* Keywords representing conditions such as AND or OR
25+
* Keywords representing conditions such as `AND` or `OR`
2626
*/
2727
class SqlConditionKeywordGroupBlock(
2828
node: ASTNode,

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/condition/SqlConditionalExpressionGroupBlock.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.domaframework.doma.intellij.formatter.block.group.subgroup.SqlSubGrou
2222
import org.domaframework.doma.intellij.formatter.util.SqlBlockFormattingContext
2323

2424
/**
25-
* A grouped conditional expression following keywords such as AND or OR
25+
* A grouped conditional expression following keywords such as `AND` or `OR`
2626
*/
2727
class SqlConditionalExpressionGroupBlock(
2828
node: ASTNode,

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/create/SqlCreateKeywordGroupBlock.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.domaframework.doma.intellij.formatter.block.group.keyword.create
1717

18-
import com.intellij.formatting.Indent
1918
import com.intellij.lang.ASTNode
2019
import com.intellij.psi.formatter.common.AbstractBlock
2120
import org.domaframework.doma.intellij.formatter.block.SqlBlock
@@ -45,13 +44,6 @@ open class SqlCreateKeywordGroupBlock(
4544

4645
override fun buildChildren(): MutableList<AbstractBlock> = mutableListOf()
4746

48-
override fun getIndent(): Indent? {
49-
if (!isAdjustIndentOnEnter() && parentBlock?.indent?.indentLevel == IndentType.SUB) {
50-
return Indent.getSpaceIndent(0)
51-
}
52-
return Indent.getNoneIndent()
53-
}
54-
5547
override fun createBlockIndentLen(preChildBlock: SqlBlock?): Int =
5648
parentBlock?.let {
5749
if (it.indent.indentLevel == IndentType.SUB) {

0 commit comments

Comments
 (0)