LanguageServer.jl
LanguageServer.jl copied to clipboard
@enum with values supplied fails
In this MWE, The RowX symbol in the export and the enum definition both emit "Missing reference: RowX". This does not happen if a value is not supplied for an enum variant.
Edit: This also occurs with the short form without begin/end.
export RowX, RowY, RowZ, RowW
@enum Row begin
RowX = 1
RowY
RowZ
RowW
end
I get the same behavior when using @with_kw from Parameters.jl to assign a default for some field.
using Parameters: @with_kw
@with_kw myType
a = 1
b
end
function do_something( mt::myType )
return mt.a + mt.b
end
In both the type definition and the function definition the linter shows "Missing reference: a".
Tested in emacs/lsp-mode using Julia 1.7.3 and LanguageServer v4.3.1.
That's not very surprising -- we don't (and can't easily) support arbitrary macros.
Ah okay. I was surprised that it worked for field b, so I thought the "bug" related.
PS: For Base.@kwdef everything seems to work as expected, no "Missing reference" there.