mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 21:17:32 +00:00
Fixed description not being stored for JSDocTypeTag
This commit is contained in:
1 parent
830f2a3d8f
commit
4741b58aed
2 files changed
+8
-6
No files matched your search
@@ -18,13 +18,13 @@ public class JSDocParser {
|
||||
"/\\*\\*([\\s\\S]*?)\\*/", Pattern.MULTILINE);
|
||||
|
||||
private static final Pattern TYPE_TAG_PATTERN = Pattern.compile(
|
||||
"@(type)\\s*\\{([^}]+)\\}", Pattern.CASE_INSENSITIVE);
|
||||
"@(type)\\s*\\{([^}]+)\\}(?:\\s*-?\\s*([^@\\n]*))?", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private static final Pattern PARAM_TAG_PATTERN = Pattern.compile(
|
||||
"@(param)\\s*(?:\\{([^}]+)\\})?\\s*(\\w+)(?:\\s*-?\\s*(.*))?", Pattern.CASE_INSENSITIVE);
|
||||
"@(param)\\s*(?:\\{([^}]+)\\})?\\s*(\\w+)(?:\\s*-?\\s*([^@\\n]*))?", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private static final Pattern RETURN_TAG_PATTERN = Pattern.compile(
|
||||
"@(returns?)\\s*(?:\\{([^}]+)\\})?(?:\\s*-?\\s*(.*))?", Pattern.CASE_INSENSITIVE);
|
||||
"@(returns?)\\s*(?:\\{([^}]+)\\})?(?:\\s*-?\\s*([^@\\n]*))?", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private static final Pattern ANY_TAG_PATTERN = Pattern.compile(
|
||||
"@(\\w+)", Pattern.CASE_INSENSITIVE);
|
||||
@@ -105,6 +105,7 @@ public class JSDocParser {
|
||||
int tagNameEnd = contentOffset + m.end(1);
|
||||
|
||||
String typeName = m.group(2).trim();
|
||||
String description = m.group(3);
|
||||
|
||||
int braceStart = content.indexOf('{', m.start());
|
||||
int braceEnd = content.indexOf('}', braceStart);
|
||||
@@ -114,7 +115,7 @@ public class JSDocParser {
|
||||
TypeInfo typeInfo = resolveType(typeName);
|
||||
|
||||
JSDocTypeTag tag = JSDocTypeTag.create(atSignOffset, tagNameStart, tagNameEnd,
|
||||
typeName, typeInfo, typeStart, typeEnd);
|
||||
typeName, typeInfo, typeStart, typeEnd, description != null ? description.trim() : null);
|
||||
info.setTypeTag(tag);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -13,10 +13,11 @@ public class JSDocTypeTag extends JSDocTag {
|
||||
super("type", atSignOffset, tagNameStart, tagNameEnd);
|
||||
}
|
||||
|
||||
public static JSDocTypeTag create(int atSignOffset, int tagNameStart, int tagNameEnd,
|
||||
String typeName, TypeInfo typeInfo, int typeStart, int typeEnd) {
|
||||
public static JSDocTypeTag create(int atSignOffset, int tagNameStart, int tagNameEnd, String typeName,
|
||||
TypeInfo typeInfo, int typeStart, int typeEnd, String description) {
|
||||
JSDocTypeTag tag = new JSDocTypeTag(atSignOffset, tagNameStart, tagNameEnd);
|
||||
tag.setType(typeName, typeInfo, typeStart, typeEnd);
|
||||
tag.setDescription(description);
|
||||
return tag;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user