mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 05:27:37 +00:00
Removed duplicate return type for JS method AutocompleteItem
This commit is contained in:
1 parent
9c222b89d4
commit
4d78c6bb2e
1 file changed
+8
-4
@@ -197,10 +197,14 @@ public class AutocompleteItem implements Comparable<AutocompleteItem> {
|
||||
StringBuilder insertText = new StringBuilder(name);
|
||||
insertText.append("(");
|
||||
insertText.append(")");
|
||||
|
||||
// Use signature for display name if available, otherwise just name
|
||||
String displayName = method.getSignature() != null && method.getSignature().contains("(") ?
|
||||
method.getSignature().substring(method.getSignature().indexOf(name)) : name + "()";
|
||||
|
||||
// Extract display name from signature: remove return type prefix and keep only name(params)
|
||||
String displayName = name;
|
||||
String sig = method.getSignature();
|
||||
int returnIndex = sig.lastIndexOf(":");
|
||||
if (returnIndex != -1) //remove ":ReturnType"
|
||||
displayName = sig.substring(0, returnIndex);
|
||||
|
||||
|
||||
return new AutocompleteItem(
|
||||
displayName,
|
||||
|
||||
Reference in new issue
Block a user