Skip to content

Commit 55c38da

Browse files
authored
[W-15663214][W-18609524] fix: syntax highlighting when @istest annotation is on the same line as the test method (#64)
* fix: syntax highlighting when @istest annotation is on the same line as the test method * fix: use a lookbehind for closing parenthesis so that the annotation includes parameters * empty commit to retrigger checks
1 parent 4682bbd commit 55c38da

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

grammars/apex.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396
</dict>
397397
</dict>
398398
<key>end</key>
399-
<string>(?&lt;=\)|$)</string>
399+
<string>(?=\s(?!\())|(?=\s*$)|(?&lt;=\s*\))</string>
400400
<key>patterns</key>
401401
<array>
402402
<dict>

grammars/apex.tmLanguage.cson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ repository:
275275
beginCaptures:
276276
'1':
277277
name: 'storage.type.annotation.apex'
278-
end: '(?<=\\)|$)'
278+
end: '(?=\\s(?!\\())|(?=\\s*$)|(?<=\\s*\\))'
279279
patterns: [
280280
{
281281
begin: '\\('
@@ -2977,4 +2977,4 @@ repository:
29772977
end: '-->'
29782978
endCaptures:
29792979
'0':
2980-
name: 'punctuation.definition.comment.apex'
2980+
name: 'punctuation.definition.comment.apex'

grammars/soql.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
</dict>
383383
</dict>
384384
<key>end</key>
385-
<string>(?&lt;=\)|$)</string>
385+
<string>(?=\s(?!\())|(?=\s*$)|(?&lt;=\s*\))</string>
386386
<key>patterns</key>
387387
<array>
388388
<dict>

src/apex.tmLanguage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ repository:
4242
- include: '#punctuation-semicolon'
4343

4444
class-or-trigger-members:
45-
patterns:
45+
patterns:
4646
- include: '#javadoc-comment'
4747
- include: '#comment'
4848
- include: '#storage-modifier'
@@ -57,7 +57,7 @@ repository:
5757
- include: '#punctuation-semicolon'
5858

5959
interface-members:
60-
patterns:
60+
patterns:
6161
- include: '#javadoc-comment'
6262
- include: '#comment'
6363
- include: '#property-declaration'
@@ -115,7 +115,7 @@ repository:
115115
begin: ([@][_[:alpha:]]+)\b
116116
beginCaptures:
117117
'1': { name: storage.type.annotation.apex }
118-
end: (?<=\)|$)
118+
end: (?=\s(?!\())|(?=\s*$)|(?<=\s*\))
119119
patterns:
120120
- begin: \(
121121
beginCaptures:
@@ -467,7 +467,7 @@ repository:
467467
- match: ([_[:alpha:]][_[:alnum:]]*)(\??\.)
468468
captures:
469469
'1': { name: variable.other.object.apex}
470-
'2':
470+
'2':
471471
patterns:
472472
- include: '#punctuation-accessor'
473473
- include: '#operator-safe-navigation'
@@ -950,7 +950,7 @@ repository:
950950
patterns:
951951
- include: '#block'
952952
- include: '#expression'
953-
953+
954954
when-string:
955955
begin: (when)(\b\s*)((\')[_.\,\'\s*[:alnum:]]+)
956956
beginCaptures:
@@ -964,7 +964,7 @@ repository:
964964
patterns:
965965
- include: '#block'
966966
- include: '#expression'
967-
967+
968968
when-string-statement:
969969
patterns:
970970
- name: string.quoted.single.apex

0 commit comments

Comments
 (0)