Skip to content

Commit

Permalink
use keys(Docs.keywords) in repl doc completion (#34982)
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-shivu authored Mar 18, 2020
1 parent 4fec34d commit 7f28d91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 1 addition & 7 deletions stdlib/REPL/src/docview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,6 @@ print_correction(word) = print_correction(stdout, word)

# Completion data

const builtins = ["abstract type", "baremodule", "begin", "break",
"catch", "ccall", "const", "continue", "do", "else",
"elseif", "end", "export", "finally", "for", "function",
"global", "if", "import", "let",
"local", "macro", "module", "mutable struct", "primitive type",
"quote", "return", "struct", "try", "using", "while"]

moduleusings(mod) = ccall(:jl_module_usings, Any, (Any,), mod)

Expand All @@ -590,7 +584,7 @@ filtervalid(names) = filter(x->!occursin(r"#", x), map(string, names))
accessible(mod::Module) =
[filter!(s -> !Base.isdeprecated(mod, s), names(mod, all = true, imported = true));
map(names, moduleusings(mod))...;
builtins] |> unique |> filtervalid
collect(keys(Base.Docs.keywords))] |> unique |> filtervalid

doc_completions(name) = fuzzysort(name, accessible(Main))
doc_completions(name::Symbol) = doc_completions(string(name))
Expand Down
8 changes: 7 additions & 1 deletion stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
using REPL.REPLCompletions
using Test
using Random

using REPL
@testset "Check symbols previously not shown by REPL.doc_completions()" begin
symbols = ["?","=","[]","[","]","{}","{","}",";","","'","&&","||","julia","Julia","new","@var_str"]
for i in symbols
@test REPL.doc_completions(i)[1]==i
end
end
let ex = quote
module CompletionFoo
using Random
Expand Down

6 comments on commit 7f28d91

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible issues were detected. A full report can be found here. cc @maleadt

Please sign in to comment.