Skip to content
  • Roland Senn's avatar
    Fix tab-completion for :break (#17989) · 48b8951e
    Roland Senn authored and Marge Bot's avatar Marge Bot committed
    In tab-completion for the `:break` command, only those
    identifiers should be shown, that are accepted in the
    `:break` command. Hence these identifiers must be
    
    - defined in an interpreted module
    - top-level
    - currently in scope
    - listed in a `ModBreaks` value as a possible breakpoint.
    
    The identifiers my be qualified or unqualified.
    
    To get all possible top-level breakpoints for tab-completeion
    with the correct qualification do:
    
    1. Build the  list called `pifsBreaks` of all pairs of
    (Identifier, module-filename) from the `ModBreaks` values.
    Here all identifiers are unqualified.
    
    2. Build the list called `pifInscope` of all pairs of
    (Identifiers, module-filename) with identifiers from
    the `GlobalRdrEnv`. Take only those identifiers that are
    in scope and have the  correct prefix.
    Here the identifiers may be qualified.
    
    3. From the `pifInscope` list seclect all pairs that can be
    found in the `pifsBreaks` list, by comparing only the
    unqualified part of the identifier.
    The remaining identifiers can be used for tab-completion.
    
    This ensures, that we show only identifiers, that can be used
    in a `:break` command.
    48b8951e