Skip to content

Commit

Permalink
REPL completion: indentifers after using must be comma separated
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Aug 12, 2017
1 parent 143c9e2 commit 1343e23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/repl/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function afterusing(string::String, startpos::Int)
r = search(rstr, r"\s(gnisu|tropmi)\b")
isempty(r) && return false
fr = reverseind(str, last(r))
return ismatch(r"^\b(using|import)\s*((\w+[.])*\w+\s*,\s*)*\w*$", str[fr:end])
return ismatch(r"^\b(using|import)\s*((\w+[.])*\w+\s*,\s*)*$", str[fr:end])
end

function bslash_completions(string, pos)
Expand Down
5 changes: 5 additions & 0 deletions test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ s = "using Base.Test, Base.Random"
c,r = test_complete(s)
@test !("RandomDevice" in c)

# issue #23226: identifiers must be separated by a comma (not a newline)
s = "using Base\nusi"
c,r = test_complete(s)
@test "using" in c

# inexistent completion inside a string
s = "Pkg.add(\"lol"
c,r,res = test_complete(s)
Expand Down

0 comments on commit 1343e23

Please sign in to comment.