Java: don't insert unnecessary space in string templates when formatting (IDEA-321466)

GitOrigin-RevId: 196fa8dfc94555bf9554fb830aad1aa1dd0dcbf3
This commit is contained in:
Bas Leijdekkers
2023-08-04 19:58:15 +00:00
committed by intellij-monorepo-bot
parent 599fb6bf19
commit 5ca7339356
@@ -1958,6 +1958,9 @@ public final class JavaSpacePropertyProcessor extends JavaElementVisitor {
if (type1 == JavaTokenType.GTGT && type2 != JavaTokenType.GT && type2 != JavaTokenType.EQ) return true;
if (type1 != JavaTokenType.GT && type2 == JavaTokenType.GTGT) return true;
// Because 21 Preview is not the highest language level.
if (ElementType.STRING_TEMPLATE_FRAGMENTS.contains(type1) || ElementType.STRING_TEMPLATE_FRAGMENTS.contains(type2)) return true;
Pair<IElementType, IElementType> key = pair(type1, type2);
Boolean result = ourTokenStickingMatrix.get(key);