fixed fromatter, plugin, site, libs for new language features

This commit is contained in:
sergeych committed 2026-01-04 01:25:16 +01:00
1 parent abb262d9cf
commit 1d9befe101
14 files changed
+218 -36

No files matched your search

@@ -83,7 +83,7 @@ object LyngFormatter {
// property accessors ending with ) or =
if (isPropertyAccessor(t)) {
return t.endsWith(")") || t.endsWith("=")
return if (t.contains('=')) t.endsWith('=') else t.endsWith(')')
}
return false
}
@@ -186,7 +186,7 @@ object LyngFormatter {
val endsWithBrace = code.trimEnd().endsWith("{")
if (!endsWithBrace && isControlHeaderNoBrace(code)) {
// It's another header, increment
awaitingExtraIndent += 1
awaitingExtraIndent += if (isAccessor) 2 else 1
} else {
// It's the body, reset
awaitingExtraIndent = 0
@@ -195,7 +195,7 @@ object LyngFormatter {
// start awaiting if current line is a control header without '{'
val endsWithBrace = code.trimEnd().endsWith("{")
if (!endsWithBrace && isControlHeaderNoBrace(code)) {
awaitingExtraIndent = 1
awaitingExtraIndent = if (isAccessor) 2 else 1
}
}