CommandHelper icon indicating copy to clipboard operation
CommandHelper copied to clipboard

Add a documentation class instead of a formatted string.

Open LadyCailinBot opened this issue 11 years ago • 3 comments
trafficstars

CMDHELPER-2915 - Reported by ACzChef

Right now functions have to pass in a string for their docs, that then later gets parsed into usable data. My suggestion is to have a documentation class where you just define all the fields such as description, return type, arguments, name, etc. and use that instead. It would be cleaner, and less error prone.

LadyCailinBot avatar Mar 08 '14 02:03 LadyCailinBot

Comment by EntityReborn

I like this. A use case could be as follows:{{ public String docs() { FunctionDocs docs = new FunctionDocs(); docs.setReturns("void"); docs.addExpects("boolean"); docs.addExpects("player, boolean"); docs.setExplanation("Something meaningful here.");

return docs.toString();

} }}

This would return:{{ "void {boolean | player, boolean} Something meaningful here." }}

This would also be implemented for Events, as I always get confused as to what goes where.

LadyCailinBot avatar Mar 08 '14 02:03 LadyCailinBot

Related to #1247, which adds the option to supply function return value and parameter descriptions.

Pieter12345 avatar Mar 18 '22 01:03 Pieter12345

Yes! We can start to phase the old docstring out if the signature is there. As a first step, I will just supercede the data in the docstring, but eventually it can be entirely removed, and the docstring will be exclusively the “body”.

LadyCailin avatar Mar 18 '22 01:03 LadyCailin