# Missing reference - JuMP variables

**URL:** <https://discourse.julialang.org/t/missing-reference-jump-variables/94865>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [February 19, 2023, 4:45am UTC](https://discourse.julialang.org/t/missing-reference-jump-variables/94865 "2023-02-19T04:45:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinqiao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevinqiao/32/44492_2.png) [@kevinqiao](https://discourse.julialang.org/u/kevinqiao)\
**Post date:** [February 19, 2023, 4:45am UTC](https://discourse.julialang.org/t/missing-reference-jump-variables/94865/1 "2023-02-19T04:45:58Z")

</div>

I’m using JuMP in vscode, and I add JuMP as

using JuMP

at the beginning of my code, and I define many variables like

@variable(hNet, injectionTemp[1:SCHTIME])  
@variable(hNet, inletTemp[1:nNode, 1:SCHTIME])  
…

while it gives me a problem that the variables, i.e., injectionTemp, inletTemp, etc. are missing reference, but, the code can be executed actually, so, what’s the real problem?

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [February 19, 2023, 6:41am UTC](https://discourse.julialang.org/t/missing-reference-jump-variables/94865/2 "2023-02-19T06:41:48Z")

</div>

> [@kevinqiao](#):
>
> are missing reference

Can you be more specific about what this means? Can you provide any error messages?

---

<div class="post-metadata">

**Author:** ![kevinqiao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevinqiao/32/44492_2.png) [@kevinqiao](https://discourse.julialang.org/u/kevinqiao)\
**Post date:** [February 19, 2023, 7:01am UTC](https://discourse.julialang.org/t/missing-reference-jump-variables/94865/3 "2023-02-19T07:01:46Z")

</div>

![problem](https://global.discourse-cdn.com/julialang/original/3X/6/e/6e687cd191dca125f172c09cbc327158febeac86.jpeg)

Just like the picture shows above.

I use the latest JuMP, and I turn off the Missingrefs suggested from [https://discourse.julialang.org/t/missing-reference-warnings-with-julia-in-vs-code/31321/7](https://discourse.julialang.org/t/missing-reference-warnings-with-julia-in-vs-code/31321/7)

And the problem is solved. Variables defined in the above method do not have code hint. 😂

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [February 19, 2023, 7:08am UTC](https://discourse.julialang.org/t/missing-reference-jump-variables/94865/4 "2023-02-19T07:08:55Z")

</div>

Indeed, the `@variable` macro creates the reference to the variable name when it is called, so you wouldn’t expect it to be a registered symbol beforehand.
