@@ -966,7 +966,7 @@ function complete_identifiers!(suggestions::Vector{Completion}, @nospecialize(ff
966
966
append! (suggestions, complete_keyval (name))
967
967
end
968
968
if dotpos > 1 && string[dotpos] == ' .'
969
- s = string[1 : dotpos- 1 ]
969
+ s = string[1 : prevind (string, dotpos) ]
970
970
# First see if the whole string up to `pos` is a valid expression. If so, use it.
971
971
ex = Meta. parse (s, raise= false , depwarn= false )
972
972
if isexpr (ex, :incomplete )
@@ -1005,6 +1005,17 @@ function complete_identifiers!(suggestions::Vector{Completion}, @nospecialize(ff
1005
1005
ex = Meta. parse (lookup_name, raise= false , depwarn= false )
1006
1006
end
1007
1007
isexpr (ex, :incomplete ) && (ex = nothing )
1008
+ elseif isexpr (ex, :call ) && length (ex. args) > 1
1009
+ isinfix = s[end ] != ' )'
1010
+ # A complete call expression that does not finish with ')' is an infix call.
1011
+ if ! isinfix
1012
+ # Handle infix call argument completion of the form bar + foo(qux).
1013
+ frange, end_of_identifier = find_start_brace (@view s[1 : end - 1 ])
1014
+ isinfix = Meta. parse (@view (s[frange[1 ]: end ]), raise= false , depwarn= false ) == ex. args[end ]
1015
+ end
1016
+ if isinfix
1017
+ ex = ex. args[end ]
1018
+ end
1008
1019
end
1009
1020
end
1010
1021
append! (suggestions, complete_symbol (ex, name, ffunc, context_module))
0 commit comments