Skip to content

Commit 17c45ed

Browse files
committed
revert changes to classify a keyword as an identifier if the last token is keyword
1 parent ad9a87d commit 17c45ed

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/services/services.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ module ts {
659659
InMultiLineCommentTrivia,
660660
InSingleQuoteStringLiteral,
661661
InDoubleQuoteStringLiteral,
662-
EndingWithKeyword,
663662
EndingWithDotToken,
664663
}
665664

@@ -2243,9 +2242,6 @@ module ts {
22432242
case EndOfLineState.EndingWithDotToken:
22442243
lastToken = SyntaxKind.DotToken;
22452244
break;
2246-
case EndOfLineState.EndingWithKeyword:
2247-
lastToken = SyntaxKind.FirstKeyword;
2248-
break;
22492245
}
22502246

22512247
var result: ClassificationResult = {
@@ -2264,7 +2260,7 @@ module ts {
22642260
token = SyntaxKind.RegularExpressionLiteral;
22652261
}
22662262
}
2267-
else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) {
2263+
else if (lastToken === SyntaxKind.DotToken) {
22682264
token = SyntaxKind.Identifier;
22692265
}
22702266

@@ -2316,9 +2312,6 @@ module ts {
23162312
else if (token === SyntaxKind.DotToken) {
23172313
result.finalLexState = EndOfLineState.EndingWithDotToken;
23182314
}
2319-
else if (isKeyword(token)) {
2320-
result.finalLexState = EndOfLineState.EndingWithKeyword;
2321-
}
23222315
}
23232316
}
23242317

tests/cases/unittests/services/colorization.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,6 @@ describe('Colorization', function () {
222222
verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier);
223223
});
224224

225-
it("classifies keyword after a keyword", function () {
226-
var results = getClassifications("module string", ts.EndOfLineState.Start);
227-
verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier);
228-
});
229-
230-
it("reports correct state with a line ending in a keyword", function () {
231-
var results = getClassifications("module", ts.EndOfLineState.Start);
232-
assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword);
233-
});
234-
235225
it("classifies keyword after a dot on previous line", function () {
236226
var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken);
237227

0 commit comments

Comments
 (0)