@@ -518,7 +518,7 @@ function bslash_completions(string, pos)::Tuple{Bool, Completions}
518
518
return (false , (Completion[], 0 : - 1 , false ))
519
519
end
520
520
521
- function dict_identifier_key (str,tag)
521
+ function dict_identifier_key (str, tag, context_module = Main )
522
522
if tag === :string
523
523
str_close = str* " \" "
524
524
elseif tag === :cmd
@@ -529,7 +529,7 @@ function dict_identifier_key(str,tag)
529
529
530
530
frange, end_of_identifier = find_start_brace (str_close, c_start= ' [' , c_end= ' ]' )
531
531
isempty (frange) && return (nothing , nothing , nothing )
532
- obj = Main
532
+ obj = context_module
533
533
for name in split (str[frange[1 ]: end_of_identifier], ' .' )
534
534
Base. isidentifier (name) || return (nothing , nothing , nothing )
535
535
sym = Symbol (name)
@@ -581,7 +581,7 @@ function completions(string, pos, context_module=Main)::Completions
581
581
inc_tag = Base. incomplete_tag (Meta. parse (partial, raise= false , depwarn= false ))
582
582
583
583
# if completing a key in a Dict
584
- identifier, partial_key, loc = dict_identifier_key (partial,inc_tag)
584
+ identifier, partial_key, loc = dict_identifier_key (partial, inc_tag, context_module )
585
585
if identifier != = nothing
586
586
matches = find_dict_matches (identifier, partial_key)
587
587
length (matches)== 1 && (lastindex (string) <= pos || string[nextind (string,pos)] != ' ]' ) && (matches[1 ]*= ' ]' )
0 commit comments