Open cstjean opened 5 years ago
Not at the moment, as it would have to query the Julia process in the background for the relevant information. PRs and suggestions are welcome, eventually I guess this should be possible with LanguageServer.
Thank you for the link to lsp-julia
Here's a suggestion in line with this package's philosophy. Send this command to julia:
julia> println(methods(findfirst)); edit(methods(findfirst).ms[parse(Int, readline())])
# 7 methods for generic function "findfirst":
[1] findfirst(A::Union{AbstractString, AbstractArray}) in Base at array.jl:1661
[2] findfirst(pred::Base.Fix2{#s57,#s56} where #s56<:Union{Int8, UInt8} where #s57<:Union{typeof(==), typeof(isequal)}, a::Union{Array{Int8,1}, Array{UInt8,1}}) in Base at strings/search.jl:22
[3] findfirst(testf::Function, A::Union{AbstractString, AbstractArray}) in Base at array.jl:1742
[4] findfirst(testf::Function, A) in Base at array.jl:1735
[5] findfirst(pattern::AbstractString, string::AbstractString) in Base at strings/search.jl:104
[6] findfirst(r::Regex, s::AbstractString) in Base at regex.jl:243
[7] findfirst(A) in Base at array.jl:1652
6 # user input
If you can get the method number from emacs and send it to the julia process, then it should work.
Here's a suggestion in line with this package's philosophy. Send this command to julia:
julia> println(methods(findfirst)); edit(methods(findfirst).ms[parse(Int, readline())]) # 7 methods for generic function "findfirst": [1] findfirst(A::Union{AbstractString, AbstractArray}) in Base at array.jl:1661 [2] findfirst(pred::Base.Fix2{#s57,#s56} where #s56<:Union{Int8, UInt8} where #s57<:Union{typeof(==), typeof(isequal)}, a::Union{Array{Int8,1}, Array{UInt8,1}}) in Base at strings/search.jl:22 [3] findfirst(testf::Function, A::Union{AbstractString, AbstractArray}) in Base at array.jl:1742 [4] findfirst(testf::Function, A) in Base at array.jl:1735 [5] findfirst(pattern::AbstractString, string::AbstractString) in Base at strings/search.jl:104 [6] findfirst(r::Regex, s::AbstractString) in Base at regex.jl:243 [7] findfirst(A) in Base at array.jl:1652 6 # user input
If you can get the method number from emacs and send it to the julia process, then it should work.
That would be great to integrate with lsp-julia
, so you get a list of definitions to jump to. I have no idea how to integrate this in with the different autocompletion systems such as helm
and ivy
.
Why not ctags?
AFAIK ctags
would require that index files are pre-generated (and updated when necessary). At the same time, this information is available in the Julia image, so @gdkrmr's suggestion would be easier to do.
LSP support developed quite a bit since this issue was opened, perhaps it is time to revisit the implementation.
This, presumably, might work also with the user's own files?
Thank you for this package! Is there something like
M-.
(aka go-to-defintion) in this package? I find thatC-c C-e
is not too useful when editing module code, because of course, the arguments can't be evaluated.