# Finding function/method definition (in e.g. VSCode) and Intellisense

**URL:** <https://discourse.julialang.org/t/finding-function-method-definition-in-e-g-vscode-and-intellisense/55899>\
**Category:** General Usage\
**Created:** [February 24, 2021, 12:04am UTC](https://discourse.julialang.org/t/finding-function-method-definition-in-e-g-vscode-and-intellisense/55899 "2021-02-24T00:04:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 24, 2021, 12:04am UTC](https://discourse.julialang.org/t/finding-function-method-definition-in-e-g-vscode-and-intellisense/55899/1 "2021-02-24T00:04:04Z")

</div>

A.  
If I do:

```julia
julia> @which select(:chosen_index; options=:drop_down)
(::Genie.Renderer.Html.var"#select##kw")(::Any, ::typeof(select), children, args...) in Genie.Renderer.Html at none:1

```

Long story short, I actually found it here (after looking through Genie.jl, then guessing Stipple\* after this misdirection; why didn’t I find this right away? for the general case, see below):

> <https://github.com/GenieFramework/StippleUI.jl/blob/25cece2eb3e8eee2a27f8e7b97b3b057a284829c/src/Select.jl#L8>

it’s not too helpful… Usually `@edit` and `@less` have been great to know about, and I suppose use the same info `@which` provides, or I guess `@functionloc` that I just found out about.

I guess while these usually work, and I find nothing more in the manual, it’s not possible?

This is unlike for:

```julia
julia> @functionloc 1+1
("/home/pharaldsson_sym/julia-1.6.0-rc1/share/julia/base/int.jl", 87)

```

a bit better to know about than only:

```julia
julia> @which 1+1
+(x::T, y::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} in Base at int.jl:87

```

I think the reason for this “at none:1” business (in general, not this case though), when I do not get a file and a real line number, is that the function I’m calling was made by a macro (always? what are to possibilities, look for eval?).

Why do I not find that macro or is there a way? Since the macro made the function and it’s kept in memory somewhere, can it be found in human-readable form, or only assembly/LLVM available? Even that might be better than nothing sometimes…

To answer my own question there’s (and the corresponding `@code_llvm` and and `@code_native` are not to helpful too verbose in this case):

```julia
julia> @code_lowered select(options=:drop_down)
CodeInfo(
1 ─ %1 = (#s50)(@_2, @_3, "")
└── return %1
)

```

possibly most helpful:

```julia
julia> @code_typed select(:chosen_index; options=:drop_down)
CodeInfo(
1 ─ %1 = %new(Base.Iterators.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:options,), Tuple{Symbol}}}, @_2, (:options,))::Base.Iterators.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:options,), Tuple{Symbol}}}
│ %2 = invoke Genie.Renderer.Html.:(var"#select#405")(%1::Base.Iterators.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:options,), Tuple{Symbol}}}, Genie.Renderer.Html.select::typeof(select), _4::Symbol)::String
└── return %2
) => String

```

B.  
What people may want (some seem to think OO means this), is to find possible methods from a type, in IDE for single-dispatch OO: `mytype.<TAB>` some drop-down box showing.

Can you do similar for multiple-dispatch: `(mytype, ` pressing TAB giving a list of methods would be awesome, or possibly with a longer list of types constraining the list: `(mytype1, mytype2, ` TAB. Is at least something similar possible in the REPL if not VSCode already?

C.  
Hovering over select in VSCode I got 8 definitions (I suppose a complete list, not something I noticed immediately), but right-clicking then “Go to Definition” gave me only 3, those from Genie.jl in the same file, and missing out on the one from StippleUI from above, and 4 others.
