Skip to content

Commit

Permalink
fix completion performance regression on v1.6:
Browse files Browse the repository at this point in the history
see JuliaLang/julia#38059 for the rationale
  • Loading branch information
aviatesk committed Oct 16, 2020
1 parent c751731 commit 50fa2bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ iskeyword(word::Symbol) = word in keys(Docs.keywords)
iskeyword(word::AbstractString) = iskeyword(Symbol(word))

ismacro(ct::AbstractString) = startswith(ct, '@') || endswith(ct, '"')
ismacro(f::Function) = startswith(string(methods(f).mt.name), "@")
# xref: https://github.com/JuliaLang/julia/issues/38059
function ismacro(@nospecialize(f::FT)) where {FT<:Function}
isdefined(FT, :name) || return false # XXX: this check might not be necessary
tn = FT.name::Core.TypeName
return occursin('@', string(tn.name))
end

# uri utilties
# ------------
Expand Down

0 comments on commit 50fa2bc

Please sign in to comment.