package common
- Alphabetic
- Public
- All
Type Members
- case class ASTElementPartBranch(node: ASTNode, position: Position, stack: Seq[ASTNode]) extends ASTPartBranch with Product with Serializable
- trait ASTPartBranch extends AnyRef
- trait DirectoryResolver extends AlsPlatformSecrets
-
case class
ElementWithIndentation(ast: ASTElement, indentation: Option[Int]) extends Product with Serializable
Wrapper for an AST element with its calculated indentation level.
Wrapper for an AST element with its calculated indentation level.
- ast
The AST element
- indentation
The indentation level in spaces, if determinable
- case class ObjectInTree(obj: AmfObject, stack: Seq[AmfObject], fieldEntry: Option[FieldEntry], astPartBranch: ASTPartBranch) extends Product with Serializable
- class PlatformDirectoryResolver extends DirectoryResolver
- trait SyncFunction extends AnyRef
-
case class
YPartBranch(node: YPart, position: Position, stack: Seq[YPart], strict: Boolean) extends ASTPartBranch with Product with Serializable
Represents a branch in the YAML AST with position context and navigation stack.
Represents a branch in the YAML AST with position context and navigation stack.
Responsibility
This case class wraps a
YPartnode with its position context and ancestor stack, providing rich navigation and query capabilities. It handles:- Determining if the current position is at a key, value, or array element
- Accessing parent entries, maps, and ancestor nodes
- Querying node properties (isMultiline, isEmptyNode, isAtRoot, etc.)
- Finding siblings and array elements
- Extracting key paths and string values
Stack Navigation
The
stackparameter contains ancestor nodes from innermost to outermost, enabling efficient parent/ancestor lookups without re-traversing the AST.Related Classes
- NodeBranchBuilder - Factory for building YPartBranch instances from positions
- org.mulesoft.als.common.YamlUtils - Simpler position-based navigation without stack
- org.mulesoft.als.common.ASTElementWrapper - Implicit extensions for containment checks
- node
The current YPart node at the position
- position
The cursor/document position (1-indexed, AMF format)
- stack
Ancestor nodes from innermost to outermost
- strict
Whether to use strict containment checks (for flow structures)
Value Members
-
object
ASTElementWrapper
Provides implicit extensions for AST element containment checks and conversions.
Provides implicit extensions for AST element containment checks and conversions.
Responsibility
This object contains implicit classes that extend AST elements (both YAML and generic) with position containment and range conversion capabilities. It handles:
- Position containment checks for various AST element types
- Range conversions between AMF and internal position formats
- Location conversions for LSP responses
- Special handling for flow structures, quoted scalars, and null values
Implicit Classes
CommonASTOps- Basic containment for any ASTElementAlsPositionRange- Range conversions and containmentYSequenceOps,YMapEntryOps,AlsYMapOps, etc. - YAML-specific containment
Position Indexing
AMF positions are 1-indexed, while internal
Positionis 0-indexed. The implicit conversions handle this transparently.Related Classes
org.mulesoft.als.common.YPartBranch- Branch navigation with stack contextorg.mulesoft.als.common.YamlUtils- Position-based YAML navigationorg.mulesoft.als.common.dtoTypes.PositionRange- Internal range representation
-
object
ASTNodeWrapper
Implicit extensions for generic ASTNode containment checks.
- object AlsAmfElement
- object AmfConfigurationPatcher
- object AmfSonElementFinder
-
object
NodeBranchBuilder
Factory object for building AST branch structures from document positions.
Factory object for building AST branch structures from document positions.
Responsibility
This object provides factory methods for creating YPartBranch and ASTElementPartBranch instances from AST elements and positions. It handles:
- Building branch structures with ancestor stacks
- Finding nodes at specific positions with proper containment logic
- Handling both YAML (YPart) and generic AST (ASTNode) structures
- Calculating indentation from stack context
- Finding mutual parents for range selections
Flow Structure Handling
The
strictparameter controls containment behavior for flow structures (inline[]and{}). When strict is true, exact position matching is used.Related Classes
- YPartBranch - The branch structure for YAML AST nodes
- ASTElementPartBranch - The branch structure for generic AST nodes
- org.mulesoft.als.common.YamlUtils - Simpler position-based navigation
- object ObjectInTreeBuilder
- object SemanticNamedElement
- object URIImplicits
-
object
YPartASTWrapper
Provides YAML-specific implicit extensions for position containment.
Provides YAML-specific implicit extensions for position containment.
Responsibility
This object contains implicit classes for YAML AST elements (YPart subclasses) with specialized containment logic that handles:
- Flow structures (
[]and{}) with adjusted boundaries - Indentation-aware containment for block structures
- Quoted scalar handling
- Null value edge cases
- Map entry key/value distinction
Flow Structure Handling
For flow structures, the containment boundaries are adjusted to exclude the opening/closing brackets, allowing proper cursor positioning inside.
- Flow structures (
-
object
YamlUtils
Utility object for position-based YAML AST navigation and queries.
Utility object for position-based YAML AST navigation and queries.
Responsibility
This object provides utilities for navigating and querying YAML AST structures based on cursor/document positions. It handles:
- Checking if a position is at a key vs value
- Finding nodes at specific positions
- Navigating parent/child relationships
- Finding siblings of nodes
- Detecting JSON vs YAML format from BaseUnit
Position Containment
Uses
PositionRangefor containment checks, converting between AMF positions (1-indexed) and internal positions (0-indexed).Related Classes
org.mulesoft.als.common.edits.YamlEditBuilder- Building TextEdits for YAML modificationsorg.mulesoft.als.common.YPartBranch- AST branch context with stack navigationorg.mulesoft.als.common.ASTElementWrapper- Implicit extensions for AST elements
- Note
For branch-based navigation with context stack, use
NodeBranchBuilderinstead.