File tree Expand file tree Collapse file tree 5 files changed +97
-0
lines changed Expand file tree Collapse file tree 5 files changed +97
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ variables:
26
26
lookBehindOf : ' ^of|{{nonPropertyLookBehind}}of'
27
27
lookBehindTypeof : ' ^typeof|{{nonPropertyLookBehind}}typeof'
28
28
lookBehindCase : ' ^case|{{nonPropertyLookBehind}}case'
29
+ lookBehindImport : ' ^import|{{nonPropertyLookBehind}}import'
29
30
matchingParenthesis : (\(([^\(\)]|(\([^\(\)]*\)))*\))
30
31
matchingBraces : (\{([^\{\}]|(\{[^\{\}]*\}))*\})
31
32
matchingBrackets : (\[([^\[\]]|(\[[^\[\]]*\]))*\])
@@ -865,6 +866,14 @@ repository:
865
866
' 2 ' : { name: keyword.control.import.ts }
866
867
end : (?=;|$|^)
867
868
patterns :
869
+ - include : ' #comment'
870
+ - include : ' #string'
871
+ - begin : (?<={{lookBehindImport}})(?!\s*["'])
872
+ end : \bfrom\b
873
+ endCaptures :
874
+ ' 0 ' : { name: keyword.control.from.ts }
875
+ patterns :
876
+ - include : ' #import-export-declaration'
868
877
- include : ' #import-export-declaration'
869
878
870
879
export-declaration :
Original file line number Diff line number Diff line change 2693
2693
<string >(?=;|$|^) </string >
2694
2694
<key >patterns </key >
2695
2695
<array >
2696
+ <dict >
2697
+ <key >include </key >
2698
+ <string >#comment </string >
2699
+ </dict >
2700
+ <dict >
2701
+ <key >include </key >
2702
+ <string >#string </string >
2703
+ </dict >
2704
+ <dict >
2705
+ <key >begin </key >
2706
+ <string >(?< =^import|[^\._$[:alnum:]]import)(?!\s*["']) </string >
2707
+ <key >end </key >
2708
+ <string >\bfrom\b </string >
2709
+ <key >endCaptures </key >
2710
+ <dict >
2711
+ <key >0 </key >
2712
+ <dict >
2713
+ <key >name </key >
2714
+ <string >keyword.control.from.ts </string >
2715
+ </dict >
2716
+ </dict >
2717
+ <key >patterns </key >
2718
+ <array >
2719
+ <dict >
2720
+ <key >include </key >
2721
+ <string >#import-export-declaration </string >
2722
+ </dict >
2723
+ </array >
2724
+ </dict >
2696
2725
<dict >
2697
2726
<key >include </key >
2698
2727
<string >#import-export-declaration </string >
Original file line number Diff line number Diff line change 2697
2697
<string >(?=;|$|^) </string >
2698
2698
<key >patterns </key >
2699
2699
<array >
2700
+ <dict >
2701
+ <key >include </key >
2702
+ <string >#comment </string >
2703
+ </dict >
2704
+ <dict >
2705
+ <key >include </key >
2706
+ <string >#string </string >
2707
+ </dict >
2708
+ <dict >
2709
+ <key >begin </key >
2710
+ <string >(?< =^import|[^\._$[:alnum:]]import)(?!\s*["']) </string >
2711
+ <key >end </key >
2712
+ <string >\bfrom\b </string >
2713
+ <key >endCaptures </key >
2714
+ <dict >
2715
+ <key >0 </key >
2716
+ <dict >
2717
+ <key >name </key >
2718
+ <string >keyword.control.from.tsx </string >
2719
+ </dict >
2720
+ </dict >
2721
+ <key >patterns </key >
2722
+ <array >
2723
+ <dict >
2724
+ <key >include </key >
2725
+ <string >#import-export-declaration </string >
2726
+ </dict >
2727
+ </array >
2728
+ </dict >
2700
2729
<dict >
2701
2730
<key >include </key >
2702
2731
<string >#import-export-declaration </string >
Original file line number Diff line number Diff line change
1
+ original file
2
+ -----------------------------------
3
+ import a
4
+ from b;
5
+ -----------------------------------
6
+
7
+ Grammar: TypeScript.tmLanguage
8
+ -----------------------------------
9
+ >import a
10
+ ^^^^^^
11
+ source.ts meta.import.ts keyword.control.import.ts
12
+ ^
13
+ source.ts meta.import.ts
14
+ ^
15
+ source.ts meta.import.ts variable.other.readwrite.alias.ts
16
+ ^^
17
+ source.ts meta.import.ts
18
+ > from b;
19
+ ^^^^
20
+ source.ts meta.import.ts
21
+ ^^^^
22
+ source.ts meta.import.ts keyword.control.from.ts
23
+ ^
24
+ source.ts meta.import.ts
25
+ ^
26
+ source.ts meta.import.ts variable.other.readwrite.alias.ts
27
+ ^
28
+ source.ts punctuation.terminator.statement.ts
Original file line number Diff line number Diff line change
1
+ import a
2
+ from b ;
You can’t perform that action at this time.
0 commit comments