From 61bb522a6424407602f4df65dda4be09c61d1b15 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 8 Dec 2025 08:57:56 -0600 Subject: [PATCH] fix: W-8095488 (ternary without space gets treated as optional chaining) --- grammars/apex.tmLanguage | 2 +- grammars/apex.tmLanguage.cson | 2 +- grammars/soql.tmLanguage | 2 +- src/apex.tmLanguage.yml | 3 +- .../classes/TernaryWithDecimals_W8095488.cls | 88 +++++++++++++++++++ .../TernaryWithDecimals_W8095488.cls-meta.xml | 6 ++ 6 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 test/repros/force-app/main/default/classes/TernaryWithDecimals_W8095488.cls create mode 100644 test/repros/force-app/main/default/classes/TernaryWithDecimals_W8095488.cls-meta.xml diff --git a/grammars/apex.tmLanguage b/grammars/apex.tmLanguage index a9d52cc..62891de 100644 --- a/grammars/apex.tmLanguage +++ b/grammars/apex.tmLanguage @@ -3798,7 +3798,7 @@ conditional-operator begin - (?<!\?)\?(?!\?|\.|\[) + (?<!\?)\?(?!\?|\.(?!\d)|\[) beginCaptures 0 diff --git a/grammars/apex.tmLanguage.cson b/grammars/apex.tmLanguage.cson index 4accb9c..c32ff83 100644 --- a/grammars/apex.tmLanguage.cson +++ b/grammars/apex.tmLanguage.cson @@ -2242,7 +2242,7 @@ repository: } ] 'conditional-operator': - begin: '(?conditional-operator begin - (?<!\?)\?(?!\?|\.|\[) + (?<!\?)\?(?!\?|\.(?!\d)|\[) beginCaptures 0 diff --git a/src/apex.tmLanguage.yml b/src/apex.tmLanguage.yml index 5915856..3fe8b27 100644 --- a/src/apex.tmLanguage.yml +++ b/src/apex.tmLanguage.yml @@ -1342,7 +1342,8 @@ repository: # Only match ? if: # 1. There isn't a preceding or trailing ? (null-coalescing operator) # 2. There isn't a trailing . or [ (null-conditional operator) - begin: (? + + 58.0 + Active + +