Skip to content

Commit

Permalink
[ #20 ] Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zxj5470 committed Feb 1, 2018
1 parent 49da608 commit 6a0177f
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/org/ice1000/julia/lang/editing/julia-code-style.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.intellij.application.options.*
import com.intellij.openapi.options.Configurable
import com.intellij.psi.codeStyle.*
import com.intellij.psi.codeStyle.CodeStyleSettings
import com.intellij.openapi.application.ApplicationBundle
import com.intellij.psi.codeStyle.CustomCodeStyleSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsProvider
import com.intellij.psi.codeStyle.CommonCodeStyleSettings
Expand Down Expand Up @@ -61,7 +60,7 @@ class JuliaLanguageCodeStyleSettingsProvider : LanguageCodeStyleSettingsProvider
consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Separator")
}
SettingsType.WRAPPING_AND_BRACES_SETTINGS -> {
consumer.showStandardOptions("WRAPPING_KEEP","WRAPPING_BRACES")
consumer.showStandardOptions("WRAPPING_KEEP", "WRAPPING_BRACES")
}
SettingsType.BLANK_LINES_SETTINGS -> consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE")
// SettingsType.LANGUAGE_SPECIFIC -> TODO()
Expand All @@ -71,7 +70,27 @@ class JuliaLanguageCodeStyleSettingsProvider : LanguageCodeStyleSettingsProvider
override fun getIndentOptionsEditor() = SmartIndentOptionsEditor()

override fun getCodeSample(settingsType: SettingsType) =
"""|#=
when (settingsType) {
SettingsType.INDENT_SETTINGS ->
"""
|type a
| s::Int
| function a(a,b)
| new(1)
| end
|end
""".trimMargin()
SettingsType.BLANK_LINES_SETTINGS ->
"""
|Blank=1
|
|
|Blank=2
|
|
""".trimMargin()
else ->
"""|#=
| BLOCK COMMENT
|=#
|module <moduleName>ice1000</moduleName>
Expand Down Expand Up @@ -109,4 +128,6 @@ class JuliaLanguageCodeStyleSettingsProvider : LanguageCodeStyleSettingsProvider
| x += 1
|end
|end""".trimMargin()
}

}

0 comments on commit 6a0177f

Please sign in to comment.