Tweak new signature logic that checks context of dollar#5073
Conversation
- modify Signature.appendClassTypeSignature() logic for the last segment to use the old logic as it appears there is other code that is not prepared for the dollar being part of the class name and expects the dollar being converted to dot
Could you please give more insights? Which code exactly, in JDT or Xtext? |
|
Is it possible to add test for this? |
There was a problem hiding this comment.
Pull request overview
This PR adjusts Signature.appendClassTypeSignature()’s handling of '$' in resolved class type signatures, aiming to restore the pre-#5064 behavior for the last segment (converting '$' to '.') to maintain compatibility with existing downstream code that expects that conversion.
Changes:
- Updated the
C_DOLLARhandling inSignature.appendClassTypeSignature()to keep'$'when it appears to be part of a non-terminal segment, but to apply the old'$'→'.'conversion when it appears to be in the last segment. - Introduced a lookahead scan to detect whether a
'.'appears after'$'in certain contexts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In Javadoc of Signature.toCharArray(): Note: This method assumes that a type signature containing a
I will add a test to SignatureTests. |
|
@iloveeclipse Just to confirm that the two XTest startswithdollar tests run succesfully with this change. |
|
can confirm this would make our test green again / restore the old behaviour |
|
Thanks Jeff for the fast fix & Christian for verification. Looks good, let's merge. |
last segment to use the old logic as it appears there is other
code that is not prepared for the dollar being part of the class
name and expects the dollar being converted to dot
What it does
See commit message.
How to test
See #5064 comments.
Author checklist