Fix svgDraw return types

Co-authored-by: FlorianWoelki <FlorianWoelki@gmx.de>
This commit is contained in:
Sidharth Vinod 2022-08-25 12:41:32 +05:30
parent 39980322bd
commit 15b160c553
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
1 changed files with 10 additions and 10 deletions

View File

@ -345,10 +345,9 @@ const buildMethodDisplay = function (parsedText) {
};
const buildLegacyDisplay = function (text) {
// if for some reason we dont have any match, use old format to parse text
// if for some reason we don't have any match, use old format to parse text
let displayText = '';
let cssStyle = '';
let memberText = '';
let returnType = '';
let methodStart = text.indexOf('(');
let methodEnd = text.indexOf(')');
@ -368,26 +367,27 @@ const buildLegacyDisplay = function (text) {
methodName = text.substring(1, methodStart).trim();
}
let parameters = text.substring(methodStart + 1, methodEnd);
let classifier = text.substring(methodEnd + 1, 1);
const parameters = text.substring(methodStart + 1, methodEnd);
const classifier = text.substring(methodEnd + 1, methodEnd + 2);
cssStyle = parseClassifier(classifier);
displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')';
if (methodEnd < memberText.length) {
if (methodEnd <= text.length) {
returnType = text.substring(methodEnd + 2).trim();
if (returnType !== '') {
returnType = ' : ' + parseGenericTypes(returnType);
displayText += returnType;
}
} else {
// finally - if all else fails, just send the text back as written (other than parsing for generic types)
displayText = parseGenericTypes(text);
}
} else {
// finally - if all else fails, just send the text back as written (other than parsing for generic types)
displayText = parseGenericTypes(text);
}
return {
displayText: displayText,
cssStyle: cssStyle,
displayText,
cssStyle,
};
};