lsp4jakarta icon indicating copy to clipboard operation
lsp4jakarta copied to clipboard

Test projects signature types not resolving correctly

Open dalidia opened this issue 3 years ago • 0 comments

Description:

Integration test fails to get the resolved type of a signature when the test Java Project is loaded.

Specification:

As an example of the current test behavior, JavaModelUtil.getResolvedTypeName() fails to find the resolved Type (returning null) even though the primaryType and the formatSignature values are correct and are found in the Test Java Project. When doing manual testing, JavaModelUtil.getResolvedTypeName() returns the right resolvedTypeName.

for (ILocalVariable var : method.getParameters()) {
    String signature = val.getTypeSignature();
    String formatSignature = signature.replace("/", ".");
    IType primaryType = param.getTypeRoot().findPrimaryType();
    String resolvedTypeName = JavaModelUtil.getResolvedTypeName(formatSignature, primaryType);
}

dalidia avatar Mar 02 '22 21:03 dalidia