REPLCompletions: limit binding completions for explicitly specified modules #54858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When completing a line where a module is explicitly accessed like
A.xxx|
, the current implementation of REPLCompletions considers all bindings available toA
(e.g., including bindings exported by modules thatA
hasusing
ed), but I think it would be more useful if the completion only includes the bindings defined byA
. For example, the completion for the lineLinearAlgebra.str|
currently looks likebut in common cases, the desired completion would look like:
excluding bindings exported by
Base
andCore.
Following this observation, this commit makes REPL completions only show bindings defined by explicitly accessed module, unless shift is pressed. If shift is pressed, all bindings available in the module are shown as before.