toJson method
Converts this and returns a Map representing a JSON object.
This allows for easy integration with dart's JsonEncoder class.
Implementation
@override
Map toJson() {
var prefix = (scopePrefix != null)? "$scopePrefix." : "";
var scopeType = isTextSyntax ? "text" : "source";
return {
"fileTypes": fileTypes,
"scopeName": "$prefix$scopeType.$langName",
"patterns": topLevelPatterns,
"repository": {
for (var item in repository)
item.identifier: item,
},
};
}