Problem with dot syntax with @classmod tag using ldoc

Hi,

All class methods are presented using colon syntax in documentation no matter which syntax occur in source files.

Example

test.lua

--- myClass.lua -- Description  -- -- @classmod  myClass local myClass = {} --- Desc of function1 function myClass:enableDebugMode() self.berryDebugModeEnabled = true end --- Desc of function2 function myClass.loadMap() self.berryDebugModeEnabled = false end return myClass

Result

O0IB2L4.png

I use ldoc 1.4.6-2 installed as rock on Win 7 64-bit.

ldurniat

You might have some luck with

--- Desc of function2 -- @function myClass.loadMap function myClass.loadMap() self.berryDebugModeEnabled = false end

At any rate, it works in similar circumstances, say when assigning to a variable.

Before I wrote here I have found this trick on github page. It don’t work for me. So I think there is no other way I need manually fix it.

i think you may have another more serious problem here:  what is the current meaning of “self” inside myClass.loadMap()

A:  either an error, attempt to reference ‘nil’; or worse, a global leak of some other assignment to “_G.self” from who-knows-where.

loadMap either needs an explicit self parameter to call it with a colon later, or needs to be defined with the colon (giving implicit self)

ie, I think ldoc may be doing you an unintended favor, by identifying a function that references self, but isn’t declared in that form

Everything is fine but thanks for vigilance:)

My true loadMap function don’t use self key word. I changed piece of my code to demonstrade my problem. 

You might have some luck with

--- Desc of function2 -- @function myClass.loadMap function myClass.loadMap() self.berryDebugModeEnabled = false end

At any rate, it works in similar circumstances, say when assigning to a variable.

Before I wrote here I have found this trick on github page. It don’t work for me. So I think there is no other way I need manually fix it.

i think you may have another more serious problem here:  what is the current meaning of “self” inside myClass.loadMap()

A:  either an error, attempt to reference ‘nil’; or worse, a global leak of some other assignment to “_G.self” from who-knows-where.

loadMap either needs an explicit self parameter to call it with a colon later, or needs to be defined with the colon (giving implicit self)

ie, I think ldoc may be doing you an unintended favor, by identifying a function that references self, but isn’t declared in that form

Everything is fine but thanks for vigilance:)

My true loadMap function don’t use self key word. I changed piece of my code to demonstrade my problem.