mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 17:39:39 +00:00
syntheticField getter
This commit is contained in:
1 parent
740d675294
commit
f78d326102
3 files changed
+9
-5
No files matched your search
+3
-3
@@ -89,8 +89,8 @@ public class JSAutocompleteProvider extends JavaAutocompleteProvider {
|
||||
if (isStaticContext && !Modifier.isStatic(field.getModifiers())) continue;
|
||||
items.add(AutocompleteItem.fromField(FieldInfo.fromReflection(field, receiverType)));
|
||||
}
|
||||
if (!receiverType.syntheticFields.isEmpty()) {
|
||||
for (FieldInfo field : receiverType.syntheticFields) {
|
||||
if (!receiverType.getSyntheticFields().isEmpty()) {
|
||||
for (FieldInfo field : receiverType.getSyntheticFields()) {
|
||||
if (isStaticContext && !field.isStatic()) continue;
|
||||
items.add(AutocompleteItem.fromField(field));
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class JSAutocompleteProvider extends JavaAutocompleteProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
for (FieldInfo field : receiverType.syntheticFields) {
|
||||
for (FieldInfo field : receiverType.getSyntheticFields()) {
|
||||
if (!context.methodsOnly) {
|
||||
if (isStaticContext && !field.isStatic()) continue;
|
||||
items.add(AutocompleteItem.fromField(field));
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ public class JavaAutocompleteProvider implements AutocompleteProvider {
|
||||
}
|
||||
}
|
||||
|
||||
for (FieldInfo field : receiverType.syntheticFields) {
|
||||
for (FieldInfo field : receiverType.getSyntheticFields()) {
|
||||
if (isStaticContext && !Modifier.isStatic(field.getModifiers()))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public class TypeInfo {
|
||||
private final TypeInfo elementType;
|
||||
|
||||
// Synthetic members injected at construction time (e.g. array built-ins: length, clone)
|
||||
public final List<FieldInfo> syntheticFields = new ArrayList<>();
|
||||
private final List<FieldInfo> syntheticFields = new ArrayList<>();
|
||||
private final List<MethodInfo> syntheticMethods = new ArrayList<>();
|
||||
|
||||
// Documentation (script-defined types)
|
||||
@@ -369,6 +369,10 @@ public class TypeInfo {
|
||||
return syntheticMethods;
|
||||
}
|
||||
|
||||
public List<FieldInfo> getSyntheticFields() {
|
||||
return syntheticFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an array type wrapping the given element type.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user