object SyamlImpl
Utility object for YAML AST formatting and reformatting operations.
Responsibility
This object provides implicit extensions for formatting YAML AST parts with proper indentation and whitespace handling. It handles:
- Formatting YPart elements (YDocument, YMap, YSequence, YMapEntry, YNode, YScalar, YComment)
- Managing indentation levels during formatting
- Handling flow vs block style YAML structures
- Token manipulation for whitespace, line breaks, and indentation
- Preserving comments during formatting
Flow Style Handling
YAML flow structures (using [] and {}) are left mostly untouched to preserve
user formatting preferences. Block style structures are reformatted with proper
indentation.
Usage
Import the implicit class to enable .format() method on YPart instances:
import org.mulesoft.als.actions.formatting.SyamlImpl._ val formatted = yDocument.format(indentSize = 2, currentIndentation = 0)
Related Classes
- org.mulesoft.als.common.edits.YamlEditBuilder - Building TextEdits for YAML modifications
- org.mulesoft.als.common.YamlUtils - Position-based YAML navigation
- org.yaml.render.YamlRender - SYAML's built-in rendering (used for scalar values)
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- SyamlImpl
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
-
sealed
trait
FlowableFormat[T <: YPart] extends AnyRef
We decided to leave YAML Flows as untouched as possible because we are not sure how to best format (maintain single line if user wrote so, expand as with yaml with indentation?) When JSON styler is unified (remove from SYAML), we should revisit this topic
- implicit sealed class YCommImpl extends AnyRef
- implicit sealed class YMapEntryImpl extends AnyRef
- implicit sealed class YMapImpl extends FlowableFormat[YMap]
- implicit sealed class YNodeImpl extends AnyRef
- implicit sealed class YNonContImpl extends AnyRef
- implicit class YPartImpl[T <: YPart] extends AnyRef
- implicit sealed class YScalarImpl extends AnyRef
- implicit sealed class YSeqImpl extends FlowableFormat[YSequence]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated