Skip to content

Fix tab-completion for :break (#17989)

Roland Senn requested to merge RolandSenn/ghc:T17989 into master

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 may 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 comapring 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.

Edited by Roland Senn

Merge request reports