mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 21:17:32 +00:00
Added FieldAccessInfo errors to hover info
This commit is contained in:
1 parent
50165677c7
commit
fc9c9e187e
2 files changed
+8
-2
No files matched your search
@@ -93,8 +93,9 @@ public class FieldAccessInfo {
|
||||
if (expectedType != null && resolvedField != null) {
|
||||
TypeInfo fieldType = resolvedField.getDeclaredType();
|
||||
if (fieldType != null && !isTypeCompatible(fieldType, expectedType)) {
|
||||
setError(ErrorType.TYPE_MISMATCH,
|
||||
"Required type: " + expectedType.getSimpleName() + ", Provided: " + fieldType.getSimpleName());
|
||||
//extra space is necessary for alignment
|
||||
setError(ErrorType.TYPE_MISMATCH, "Provided type: " + fieldType.getSimpleName()+
|
||||
"\nRequired: " + expectedType.getSimpleName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +171,11 @@ public class TokenHoverInfo {
|
||||
}
|
||||
}
|
||||
|
||||
FieldAccessInfo fieldAccessInfo = token.getFieldAccessInfo();
|
||||
if (fieldAccessInfo != null && fieldAccessInfo.hasError()) {
|
||||
errors.add(fieldAccessInfo.getErrorMessage());
|
||||
}
|
||||
|
||||
FieldInfo fieldInfo = token.getFieldInfo();
|
||||
if (fieldInfo != null && !fieldInfo.isResolved()) {
|
||||
errors.add("Cannot resolve symbol '" + token.getText() + "'");
|
||||
|
||||
Reference in new issue
Block a user