Fixed HoverInfo not being created for method declarations (as MethodInfo was never assigned to mark creation)

This commit is contained in:
bigguy345 committed 2025-12-26 21:38:22 +02:00
1 parent 25800e9c3d
commit 50165677c7
1 file changed
+12 -2
@@ -1267,10 +1267,20 @@ public class ScriptDocument {
continue;
}
// Find the corresponding MethodInfo created in parseMethodDeclarations
int methodDeclStart = m.start();
MethodInfo methodInfo = null;
for (MethodInfo method : methods) {
if (method.getDeclarationOffset() == methodDeclStart) {
methodInfo = method;
break;
}
}
// Return type
marks.add(new ScriptLine.Mark(m.start(1), m.end(1), TokenType.TYPE_DECL));
// Method name
marks.add(new ScriptLine.Mark(m.start(2), m.end(2), TokenType.METHOD_DECL));
// Method name with MethodInfo metadata
marks.add(new ScriptLine.Mark(m.start(2), m.end(2), TokenType.METHOD_DECL, methodInfo));
}
}