File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
tests/cases/unittests/services Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -648,6 +648,10 @@ module ts {
648
648
return SyntaxKind . FirstKeyword <= token && token <= SyntaxKind . LastKeyword ;
649
649
}
650
650
651
+ export function isTrivia ( token : SyntaxKind ) {
652
+ return SyntaxKind . FirstTriviaToken <= token && token <= SyntaxKind . LastTriviaToken ;
653
+ }
654
+
651
655
export function isModifier ( token : SyntaxKind ) : boolean {
652
656
switch ( token ) {
653
657
case SyntaxKind . PublicKeyword :
Original file line number Diff line number Diff line change @@ -4556,7 +4556,7 @@ module ts {
4556
4556
token = SyntaxKind . RegularExpressionLiteral ;
4557
4557
}
4558
4558
}
4559
- else if ( lastNonTriviaToken === SyntaxKind . DotToken ) {
4559
+ else if ( lastNonTriviaToken === SyntaxKind . DotToken && isKeyword ( token ) ) {
4560
4560
token = SyntaxKind . Identifier ;
4561
4561
}
4562
4562
@@ -4611,10 +4611,6 @@ module ts {
4611
4611
result . entries . push ( { length : length , classification : classification } ) ;
4612
4612
}
4613
4613
}
4614
-
4615
- function isTrivia ( token : SyntaxKind ) {
4616
- return SyntaxKind . FirstTriviaToken <= token && token <= SyntaxKind . LastTriviaToken ;
4617
- }
4618
4614
}
4619
4615
4620
4616
function isBinaryExpressionOperatorToken ( token : SyntaxKind ) : boolean {
Original file line number Diff line number Diff line change @@ -189,6 +189,12 @@ describe('Colorization', function () {
189
189
identifier ( "var" ) ) ;
190
190
} ) ;
191
191
192
+ it ( "correctly classifies a string literal after a dot" , function ( ) {
193
+ test ( "a.\"var\"" ,
194
+ ts . EndOfLineState . Start ,
195
+ stringLiteral ( "\"var\"" ) ) ;
196
+ } ) ;
197
+
192
198
it ( "correctly classifies a keyword after a dot separated by comment trivia" , function ( ) {
193
199
test ( "a./*hello world*/ var" ,
194
200
ts . EndOfLineState . Start ,
You can’t perform that action at this time.
0 commit comments