InferredTypeProvider

dotty.tools.pc.InferredTypeProvider
final class InferredTypeProvider(params: OffsetParams, driver: InteractiveDriver, config: PresentationCompilerConfig, symbolSearch: SymbolSearch)(using x$5: ReportContext)

Tries to calculate edits needed to insert the inferred type annotation in all the places that it is possible such as:

  • value or variable declaration
  • methods
  • pattern matches
  • for comprehensions
  • lambdas

The provider will not check if the type does not exist, since there is no way to get that data from the presentation compiler. The actual check is being done via scalameta parser in InsertInferredType code action.

Value parameters

config

presentation compielr configuration

driver

Scala 3 interactive compiler driver

params

position and actual source

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

case class AdjustTypeOpts(text: String, adjustedEndPos: Position)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def inferredTypeEdits(adjustOpt: Option[AdjustTypeOpts]): List[TextEdit]