From 4e17787cb5f8e69b97540a5e1d70c3f9b4fa7704 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 12 Sep 2014 16:49:45 -0700 Subject: [PATCH] Do not colorize a keyword following an identifier. as it is likely an error scenario as the user is typing --- src/services/services.ts | 7 ------- tests/cases/unittests/services/colorization.ts | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 42913ac64d4..26469a1fd1a 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -692,7 +692,6 @@ module ts { InMultiLineCommentTrivia, InSingleQuoteStringLiteral, InDoubleQuoteStringLiteral, - EndingWithDotToken, } export enum TokenClass { @@ -3502,9 +3501,6 @@ module ts { text = "/*\n" + text; offset = 3; break; - case EndOfLineState.EndingWithDotToken: - lastToken = SyntaxKind.DotToken; - break; } var result: ClassificationResult = { @@ -3572,9 +3568,6 @@ module ts { : EndOfLineState.InSingleQuoteStringLiteral; } } - else if (token === SyntaxKind.DotToken) { - result.finalLexState = EndOfLineState.EndingWithDotToken; - } } } diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index 414942bbded..7b8ee376064 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -170,8 +170,8 @@ describe('Colorization', function () { it("classifies keyword after a dot on previous line", function () { test("var", - ts.EndOfLineState.EndingWithDotToken, - identifier("var"), + ts.EndOfLineState.Start, + keyword("var"), finalEndOfLineState(ts.EndOfLineState.Start)); }); });