Class KotlinComponentResolver

java.lang.Object
com.vaadin.copilot.kotlinrewriter.KotlinComponentResolver

public final class KotlinComponentResolver extends Object
Resolves a selected component to its place in a Kotlin source.

The Kotlin counterpart of ComponentInfoFinder, and the single entry point for both reading and writing. That matters more than it sounds: the panel and an edit must land on the same constructor call, and the hard part of agreeing is the occurrence rule below, which neither caller should be re-deriving.

  • Constructor Details

    • KotlinComponentResolver

      public KotlinComponentResolver(KotlinFileSourceProvider sources, Function<com.vaadin.flow.component.Component,List<ComponentTypeAndSourceLocation>> siblings)
      Parameters:
      sources - where parsed sources come from, so edits to one file accumulate
      siblings - the selected component's peers under its parent, used to work out which of several same-line creations it is
  • Method Details