Skip to content

Commit

Permalink
fix(lang-monarch): EnterSupport is not created when language config…
Browse files Browse the repository at this point in the history
…uration does not offer `onEnterRules`
  • Loading branch information
Rosemoe committed Dec 9, 2024
1 parent 6fa1444 commit 7e903a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,7 @@ class MonarchNewlineHandler(
val brackets = languageConfiguration.brackets

val indentationsRules = languageConfiguration.indentationRules
if (enterRules != null) {
enterSupport =
OnEnterSupport(
brackets,
enterRules
)
}
enterSupport = OnEnterSupport(brackets, enterRules)

if (indentationsRules != null) {
indentRulesSupport = IndentRulesSupport(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class LanguageConfigurationAdapter : JsonAdapter<LanguageConfiguration>() {

var indentationRules: IndentationRule? = null

var onEnterRules: List<OnEnterRule>? = null
var onEnterRules: List<OnEnterRule> = listOf()

var autoCloseBefore: String? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data class LanguageConfiguration(
/**
* The language's rules to be evaluated when pressing Enter.
*/
val onEnterRules: List<OnEnterRule>? = null,
val onEnterRules: List<OnEnterRule> = listOf(),
/**
* The language's auto closing pairs. The 'close' character is automatically inserted with the
* 'open' character is typed. If not set, the configured brackets will be used.
Expand Down

0 comments on commit 7e903a0

Please sign in to comment.