Skip to content

[Nvim] LanguageServer does not find types defined inside an @eval block. #1346

@MarcoRiggirello

Description

@MarcoRiggirello

As the title says, when I define a type inside @eval block the language is not able to find it.
Here's a MWE

x = :MyAbstractType
y = :MyConcreteType

@eval begin
    abstract type $(x) end
    struct $(y) <: $(x)
        a::Real
    end
end

z = MyConcreteType(3)

This code works fine in the REPL but in nvim I get this warning from lsp:

Image

I'm using julia 1.11.3 installed with juliaup and nvim v0.10.4 on linux. Here you can find my nvim config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions