# LSP "Missing reference" woes

**URL:** <https://discourse.julialang.org/t/lsp-missing-reference-woes/98231>\
**Category:** General Usage\
**Created:** [May 3, 2023, 4:03am UTC](https://discourse.julialang.org/t/lsp-missing-reference-woes/98231 "2023-05-03T04:03:40Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [May 4, 2023, 2:37pm UTC](https://discourse.julialang.org/t/lsp-missing-reference-woes/98231/11 "2023-05-04T14:37:31Z")

</div>

> [@PetrKryslUCSD](#):
>
> apparent problem VS Code has with  
> suggesting completions from the current package?

AFAICT, VS Code (or the Language Server, more precisely) has trouble with source code that _uses_ the current package but is not part of it. Such as scripts, that are typically placed outside the `src` subdir (which seems to be the case of your `acousticcolorplot.jl` file above).

I know of 2 (rather hacky) ways to work around this problem:

1. put the bulk of the script code in a function inside the sources of the package (`ACol` in your case). Then your script becomes mostly empty: it reduces to something like

2. trick the Language Server into thinking that your script is actually part of the package sources (but in a separate Module so that it sees the same exported names as an independent piece of code). It seems that this can be achieved by putting something like this in `ACol.jl`:

---

_[View the full topic](https://discourse.julialang.org/t/lsp-missing-reference-woes/98231)._
