diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index fa5fd8434bec7..5412f6f157ada 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -384,6 +384,7 @@ function get_value(sym::Expr, fn) end get_value(sym::Symbol, fn) = isdefined(fn, sym) ? (getfield(fn, sym), true) : (nothing, false) get_value(sym::QuoteNode, fn) = isdefined(fn, sym.value) ? (getfield(fn, sym.value), true) : (nothing, false) +get_value(sym::GlobalRef, fn) = get_value(sym.name, sym.mod) get_value(sym, fn) = (sym, true) # Return the value of a getfield call expression @@ -456,6 +457,11 @@ function get_type(sym::Expr, fn::Module) # try to analyze nests of calls. if this fails, try using the expanded form. val, found = try_get_type(sym, fn) found && return val, found + # https://github.com/JuliaLang/julia/issues/27184 + if isexpr(sym, :macrocall) + _, found = get_type(first(sym.args), fn) + found || return Any, false + end return try_get_type(Meta.lower(fn, sym), fn) end diff --git a/stdlib/REPL/test/replcompletions.jl b/stdlib/REPL/test/replcompletions.jl index 8a1d2f39a18f4..876fcef912d7e 100644 --- a/stdlib/REPL/test/replcompletions.jl +++ b/stdlib/REPL/test/replcompletions.jl @@ -1109,3 +1109,10 @@ let s = "test_dict[\"ab" c, r = test_complete_context(s) @test c == Any["\"abc\"", "\"abcd\""] end + +# https://github.com/JuliaLang/julia/issues/27184 +let + (test_complete("@noexist."); @test true) + (test_complete("Main.@noexist."); @test true) + (test_complete("@Main.noexist."); @test true) +end