1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-04 18:48:20 +08:00

fix(comment): Fixed yaml comments

This commit is contained in:
2025-03-04 01:24:12 +08:00
parent c2a9e2254c
commit bc3e4b3e6f
4 changed files with 19 additions and 2 deletions
@@ -49,6 +49,17 @@ public interface CommentableMeta {
FooterComments.class, FOOTER,
a -> Arrays.asList(a.value())
);
initializer.registerAnnotation(InlineComment.class, INLINE, a -> {
Map<String, String> map = new HashMap<>();
if (a.regex().length == 0) { // for current path
map.put(null, a.value());
return map;
}
for (String regex : a.regex()) { // for specified path
map.put(regex, a.value());
}
return map;
});
initializer.registerAnnotation(InlineComments.class, INLINE, a -> {
Map<String, String> map = new HashMap<>();
for (InlineComment comment : a.value()) {