Skip to content

Commit 90c32a1

Browse files
committed
Fix SQL annotation formatting to use correct indent options for Java files
1 parent e770e7f commit 90c32a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/org/domaframework/doma/intellij/formatter/processor/InjectionSqlFormatter.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.domaframework.doma.intellij.formatter.processor
1717

1818
import com.intellij.application.options.CodeStyle
19+
import com.intellij.ide.highlighter.JavaFileType
1920
import com.intellij.lang.injection.InjectedLanguageManager
2021
import com.intellij.openapi.command.WriteCommandAction
2122
import com.intellij.openapi.editor.Document
@@ -45,7 +46,7 @@ class InjectionSqlFormatter(
4546

4647
private fun createSpaceIndent(project: Project): String {
4748
val settings = CodeStyle.getSettings(project)
48-
val java = settings.indentOptions
49+
val java = settings.getIndentOptions(JavaFileType.INSTANCE)
4950
val indentSize = java.INDENT_SIZE
5051
val prefixLen = "@Sql(\"\"\"".length
5152
return StringUtil.SINGLE_SPACE.repeat(indentSize.plus(prefixLen))

0 commit comments

Comments
 (0)