Completion of last commit

This commit is contained in:
bigguy345 committed 2026-03-06 20:52:28 +02:00
1 parent 98885faaa2
commit 831ef6c4f9
2 files changed
+27 -10

No files matched your search

@@ -662,9 +662,7 @@ public class AutocompleteItem implements Comparable<AutocompleteItem> {
MethodInfo methodInfo = (MethodInfo) sourceData;
java.lang.reflect.Method javaMethod = methodInfo.getJavaMethod();
if (javaMethod != null) {
if (!Object.class.equals(javaMethod.getDeclaringClass())) return false;
TypeInfo containingType = methodInfo.getContainingType();
return containingType == null || !containingType.getFullName().equals("java.lang.Object");
return Object.class.equals(javaMethod.getDeclaringClass());
}
TypeInfo containingType = methodInfo.getContainingType();
return containingType != null
@@ -100,6 +100,16 @@ public class JSAutocompleteProvider extends JavaAutocompleteProvider {
}
}
}
if (!isStaticContext && javaClass != Object.class) {
JSTypeInfo objJSType = registry.getType("Object");
if (objJSType != null) {
for (JSMethodInfo m : objJSType.getMethods().values()) {
if (!m.isStatic()) {
items.add(AutocompleteItem.fromJSMethod(m, receiverType, 1, context.methodsOnly));
}
}
}
}
return;
}
@@ -120,13 +130,22 @@ public class JSAutocompleteProvider extends JavaAutocompleteProvider {
if (!context.methodsOnly && ConfigScript.ShowImplementationFieldsInAutocomplete) {
addFieldsFromType(jsTypeInfo, receiverType, items, new HashSet<>(), isStaticContext);
}
if (!isStaticContext) {
JSTypeInfo objJSType = registry.getType("Object");
if (objJSType != null) {
for (JSMethodInfo m : objJSType.getMethods().values()) {
if (!m.isStatic()) {
items.add(AutocompleteItem.fromJSMethod(m, receiverType, 1, context.methodsOnly));
}
}
if (!isStaticContext) {
Set<String> addedObjMethods = new HashSet<>();
for (Method m : Object.class.getMethods()) {
if (!Modifier.isPublic(m.getModifiers()) || Modifier.isStatic(m.getModifiers())) continue;
String sig = m.getName() + "(" + m.getParameterCount() + ")";
if (addedObjMethods.add(sig)) {
items.add(AutocompleteItem.fromMethod(MethodInfo.fromReflection(m, receiverType), context.methodsOnly));
}
}
JSTypeInfo objJSType = registry.getType("Object");
if (objJSType != null) {
for (JSMethodInfo m : objJSType.getMethods().values()) {
if (!m.isStatic()) {
items.add(AutocompleteItem.fromJSMethod(m, receiverType, 1, context.methodsOnly));
}
}
}