import sys.io.File;
import json2object.utils.JsonSchemaWriter;
using StringTools;
class Main {
static function main() {
var schema = new JsonSchemaWriter<Config>("\t").schema;
schema = schema.replace('"description"', '"markdownDescription"');
File.saveContent("schema.json", schema);
}
}
typedef Config = {
/** stuff **/
var foo:Foo;
}
enum abstract Foo(String) {
/** a **/
var A;
/** b **/
var B;
}
IIRC, this was a workaround for descriptions of enum values and enum only supporting that via VSCode's non-standard enumDescriptions / markdownEnumDescriptions. Originally we thought the approaches are equivalent, but it looks like that's not the case.
Hover with the generated schema:
With the schema edited to use the VSCode schema style:
Generates something like this:
IIRC, this was a workaround for descriptions of enum values and
enum
only supporting that via VSCode's non-standardenumDescriptions
/markdownEnumDescriptions
. Originally we thought the approaches are equivalent, but it looks like that's not the case.Hover with the generated schema:
With the schema edited to use the VSCode schema style: