feat: Add API for custom annotation convention

This commit is contained in:
danymat
2022-02-04 11:05:14 +01:00
parent 11018d4e71
commit 78d3658349

View File

@@ -119,5 +119,18 @@ neogen_template.add_default_annotation = function(self, name)
end
-- TODO: add API to create your own annotation convention
--- Add a custom annotation convention to the template
---@param name string The name of the annotation convention
---@param annotation table The annotation template (see |neogen-annotation|)
---@param default boolean|nil Marks the annotation as default one
---@tag neogen-template-api.add_custom_annotation()
neogen_template.add_custom_annotation = function(self, name, annotation, default)
if default == true then
self.annotation_convention = name
end
self[name] = annotation
return self
end
return neogen_template