julia-vscode / julia-vscode

Julia extension for Visual Studio Code
https://www.julia-vscode.org/
Other
1.28k stars 203 forks source link

Linter: Missing reference for main module in environment #1023

Open MFairley opened 4 years ago

MFairley commented 4 years ago

I cannot get the linter to recognize the core module for an environment. I get a missing reference error. Am I doing something wrong or is this a bug?

Here's a MWE:

(v1.3) pkg> generate TestVS

shell> cd TestVS/

(v1.3) pkg> activate .

(TestVS) pkg> status

Project TestVS v0.1.0
    Status `~/Git-Projects/TestVS/Project.toml`

Now I open up the folder ~/Git-Projects/TestVS in VSCode and set the environment to TestVS. I create a new file ~/Git-Projects/TestVS/src/lint.jl and type using TestVS at the top. A few seconds later the Linter underlines TestVS and has a message: "Missing reference: TestVS".

I have the same issue on 0.14.9 and 0.13.1

PetrKryslUCSD commented 4 years ago

None of my code in the current environment is recognized: missing references. image This shows as hundreds of warnings, but there is no error.

NikEyX commented 4 years ago

I have encountered that as well - has there been any progress in the meantime? Is there a workaround available?

MrVPlusOne commented 2 years ago

For those that encountered a similar problem, the best workaround I've found so far is to simply add a "fake" include(<my module>) line before the using statement.

For example, my project is called SEDL and is not resolved by the linter in my script files, as shown below image

And we can make the linter happy by simply add the line !true && include("../src/SEDL.jl"). image