Completer

dotty.tools.dotc.interactive.Completion.Completer
class Completer(val mode: Mode, val prefix: String, pos: SourcePosition)

Computes code completions depending on the context in which completion is requested

Value parameters

mode

Should complete names of terms, types or both

pos

Cursor position where completion was requested For the results of all xyzCompletions methods term names and type names are always treated as different keys in the same map and they never conflict with each other.

prefix

The prefix that all suggested completions should start with

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def directMemberCompletions(qual: Tree)(using Context): CompletionMap

Completions for members of qual's type. These include inherited definitions but not members added by extensions or implicit conversions

Completions for members of qual's type. These include inherited definitions but not members added by extensions or implicit conversions

Attributes

def scopeCompletions(using context: Context): CompletionMap

Completions for terms and types that are currently in scope: the members of the current class, local definitions and the symbols that have been imported, recursively adding completions from outer scopes. In case a name is ambiguous, no completions are returned for it. This mimics the logic for deciding what is ambiguous used by the compiler. In general in case of a name clash symbols introduced in more deeply nested scopes have higher priority and shadow previous definitions with the same name although:

Completions for terms and types that are currently in scope: the members of the current class, local definitions and the symbols that have been imported, recursively adding completions from outer scopes. In case a name is ambiguous, no completions are returned for it. This mimics the logic for deciding what is ambiguous used by the compiler. In general in case of a name clash symbols introduced in more deeply nested scopes have higher priority and shadow previous definitions with the same name although:

  • imports with the same level of nesting cause an ambiguity
  • members and local definitions with the same level of nesting are allowed for overloading
  • an import is ignored if there is a local definition or a member introduced in the same scope (even if the import follows it syntactically)
  • a more deeply nested import shadowing a member or a local definition causes an ambiguity

Attributes

def selectionCompletions(qual: Tree)(using Context): CompletionMap

Completions for selections from a term. Direct members take priority over members from extensions and so do members from extensions over members from implicit conversions

Completions for selections from a term. Direct members take priority over members from extensions and so do members from extensions over members from implicit conversions

Attributes

def widenQualifier(qual: Tree)(using Context): Tree

Widen only those types which are applied or are exactly nothing

Widen only those types which are applied or are exactly nothing

Attributes

Concrete fields

val mode: Mode
val prefix: String

Extensions

Extensions

extension (denotations: Seq[SingleDenotation])
def groupByName(using Context): CompletionMap
extension [N <: Name](namedDenotations: Seq[(N, SingleDenotation)])
def groupByName: CompletionMap