# Julia LSP on parametric structs

**URL:** <https://discourse.julialang.org/t/julia-lsp-on-parametric-structs/115069>\
**Category:** General Usage\
**Created:** [June 1, 2024, 7:47pm UTC](https://discourse.julialang.org/t/julia-lsp-on-parametric-structs/115069 "2024-06-01T19:47:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![co1emi11er](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/co1emi11er/32/206849_2.png) [@co1emi11er](https://discourse.julialang.org/u/co1emi11er)\
**Post date:** [June 1, 2024, 7:47pm UTC](https://discourse.julialang.org/t/julia-lsp-on-parametric-structs/115069/1 "2024-06-01T19:47:48Z")

</div>

Hi,

I had a question about getting IntelliSense working for a defined object.

```julia
 abstract type Shape end

struct Square <: Shape
    s::Float64
end

struct Rectangle <: Shape
    b::Float64
    w::Float64
end

struct Box{T<:Shape}
    shape::T
    length::Float64
end

shape = Square(5)

box = Box{Square}(shape, 6)

box.shape.

```

When I type `box.` I get the following IntelliSense:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/b/4bc64cf6ac2cab82d0c9e7620fe35b4cd07891b1.png)

However, I do not get this when I do `box.shape.`. Is there any way to get IntelliSense here or does it have to be a concrete type in the definition of the Box struct definition?

---

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [June 3, 2024, 6:15am UTC](https://discourse.julialang.org/t/julia-lsp-on-parametric-structs/115069/2 "2024-06-03T06:15:00Z")

</div>

Type inference in Julia can go through arbitrary code. Here, the IDE successfully inferred the type of your box as Box, but not necessarily its parameter. IDE has to be responsive, even before the code is even run, so it can’t infer types as deep as the compiler can.

---

<div class="post-metadata">

**Author:** ![simsurace](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simsurace/32/30216_2.png) [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Post date:** [June 3, 2024, 8:06am UTC](https://discourse.julialang.org/t/julia-lsp-on-parametric-structs/115069/3 "2024-06-03T08:06:38Z")

</div>

I would bet a few loafs of bread that this sort of thing could be inferred a few levels deep with reasonable latency.
