Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@class tag always trigger : 'class' cannot have multiple values; {MyClass,module} #411

Open
kedare opened this issue Nov 20, 2024 · 1 comment

Comments

@kedare
Copy link

kedare commented Nov 20, 2024

Hello.

I am trying to document simple lua file with classes, as soon as I try to use the @class tag somewhere, for example on this simple file

--- A Metric
---@class Metric
---@field name string the name of the metric
---@field value number the value of the metric
---@field labels { [string]: string } the labels of the metric
Metric = {}

function Metric:new(object)
    object = object or {}
    setmetatable(object, self)
    self.__index = self
    return object
end

return Metric

I keep getting the following error

ldoc --lls -a -d dist/docs/lua src/prometheus/metric.lua
src/prometheus/metric.lua:16: ?: 'class' cannot have multiple values; {Metric,module}

(same without --lls)

No issue however when I run it on file containing for example only a @module annotation.

Is there something broken or am I doing it wrong ?

No issue however with IDE autocompletion with those same annotations (PyCharm)

ldoc v1.5.0

Thanks

@Tieske
Copy link
Member

Tieske commented Nov 20, 2024

I always struggle with this one as well. Try and find some other examples an mimic those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants