# \`Missing Reference: \_\` using Chain.jl

**URL:** https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334
**Category:** VS Code
**Created:** [May 4, 2023, 4:18pm UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334 "2023-05-04T16:18:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)
#### Post date: [May 4, 2023, 4:18pm UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334/1 "2023-05-04T16:18:17Z")

</div>

I have been enjoying using Chain.jl. However, the VSCode Linter’s Missing Reference check doesn’t like that it requires using the underscore symbol without declaring a value for it. Is there any workaround for these false positives? Perhaps a way to tell the linter to ignore certain symbols?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [May 4, 2023, 4:42pm UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334/2 "2023-05-04T16:42:04Z")

</div>

Chain.jl really doesn’t play well with linting, because you use the “wrong” call syntax from the linter’s perspective when you omit the first argument… Similarly with the underscore. I don’t know if there’s any way to deal with that except completely disabling linting.

---

<div class="post-metadata">

### Author: ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)
#### Post date: [May 4, 2023, 4:47pm UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334/3 "2023-05-04T16:47:34Z")

</div>

I thought so. Ah well! Thanks for the sanity check!

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [May 4, 2023, 4:50pm UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334/4 "2023-05-04T16:50:27Z")

</div>

In principle, I guess Chain might be common enough and simple enough that one could write linter exceptions for it. But you quickly get into difficult territory like that.

---

<div class="post-metadata">

### Author: ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)
#### Post date: [May 4, 2023, 5:01pm UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334/5 "2023-05-04T17:01:34Z")

</div>

It would be very cool if we could get the linter tools to the point where it could expand the macro and only mark errors if the resulting transformation still had missing references and whatnot. But even my intermediate knowledge of metaprogramming is enough to know that is… a thorny problem 😅

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [May 5, 2023, 7:21am UTC](https://discourse.julialang.org/t/missing-reference-using-chain-jl/98334/6 "2023-05-05T07:21:32Z")

</div>

This is similar to what Pluto.jl does for its code analysis, they also have to pre-expand macros so they know if variables are going to be created / modified. @fonsp I always thought that the main problem here is that a macro could in theory run arbitrary code, and that could even be stateful. Have you run into many such cases with Pluto or are macro writers generally well-behaved? 🙂
