Skip to content

Julia: missing reference for macro defined variables #34

@Tambup

Description

@Tambup

Hello.
I have the following false positive "Julia: missing reference" warning in presence of variables defined inside a macro.

Here an example:

using JuMP, HiGHS

model = direct_model(HiGHS.Optimizer())
@variable(model, x[i=1:10] .>= 0)                        # getting "Julia: Missing reference: x"
@constraint(model, convex, x .== 1)                     # getting "Julia: Missing reference: x" and "Julia: Missing reference: convex"

I understand it is a missing reference as the variable "x" is defined inside the @variable macro, but is there a way to let the LSP understand it or to omit the warning just for that specific line?

Something similar happens with DataFrames.
If I access the column "col1" as "df.col1", it is marked as missing. Same as before, can I inform the LSP or omit the warning, just for that line?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    external:lspRelated to LanguageServer.jl

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions