CaseKeywordCompletion

dotty.tools.pc.completions.CaseKeywordCompletion

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def contribute(selector: Tree, completionPos: CompletionPos, indexedContext: IndexedContext, config: PresentationCompilerConfig, search: SymbolSearch, parent: Tree, autoImportsGen: AutoImportsGenerator, patternOnly: Option[String], hasBind: Boolean, includeExhaustive: Option[NewLineOptions]): List[CompletionValue]

A case completion showing the valid subtypes of the type being deconstructed.

A case completion showing the valid subtypes of the type being deconstructed.

Value parameters

completionPos

the position of the completion

hasBind

true when case _: @@ =>, if hasBind we don't need unapply completions

parent

the parent tree node of the pattern match, for example Apply(_, _) when in List(1).foreach { cas@@ }, used as fallback to compute the type of the selector when it's EmptyTree.

patternOnly

None for case@@, Some(query) for case query@@ => or case ab: query@@ =>

selector

selector of selector match { cases } or EmptyTree when not in a match expression (for example List(1).foreach { case@@ }.

typedtree

typed tree of the file, used for generating auto imports

Attributes

def matchContribute(selector: Tree, completionPos: CompletionPos, indexedContext: IndexedContext, config: PresentationCompilerConfig, search: SymbolSearch, autoImportsGen: AutoImportsGenerator, noIndent: Boolean): List[CompletionValue]

A match keyword completion to generate an exhaustive pattern match for sealed types.

A match keyword completion to generate an exhaustive pattern match for sealed types.

Value parameters

completionPos

the position of the completion

selector

the match expression being deconstructed or EmptyTree when not in a match expression (for example List(1).foreach { case@@ }.

typedtree

typed tree of the file, used for generating auto imports

Attributes

def sealedStrictDescendants(sym: Symbol)(using Context): List[Symbol]
def subclassesForType(tpe: Type)(using Context): List[Symbol]