Skip to content

Commit 4e17787

Browse files
committed
Do not colorize a keyword following an identifier.<newLine> as it is likely an error scenario as the user is typing
1 parent 5d577df commit 4e17787

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/services/services.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ module ts {
692692
InMultiLineCommentTrivia,
693693
InSingleQuoteStringLiteral,
694694
InDoubleQuoteStringLiteral,
695-
EndingWithDotToken,
696695
}
697696

698697
export enum TokenClass {
@@ -3502,9 +3501,6 @@ module ts {
35023501
text = "/*\n" + text;
35033502
offset = 3;
35043503
break;
3505-
case EndOfLineState.EndingWithDotToken:
3506-
lastToken = SyntaxKind.DotToken;
3507-
break;
35083504
}
35093505

35103506
var result: ClassificationResult = {
@@ -3572,9 +3568,6 @@ module ts {
35723568
: EndOfLineState.InSingleQuoteStringLiteral;
35733569
}
35743570
}
3575-
else if (token === SyntaxKind.DotToken) {
3576-
result.finalLexState = EndOfLineState.EndingWithDotToken;
3577-
}
35783571
}
35793572
}
35803573

tests/cases/unittests/services/colorization.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ describe('Colorization', function () {
170170

171171
it("classifies keyword after a dot on previous line", function () {
172172
test("var",
173-
ts.EndOfLineState.EndingWithDotToken,
174-
identifier("var"),
173+
ts.EndOfLineState.Start,
174+
keyword("var"),
175175
finalEndOfLineState(ts.EndOfLineState.Start));
176176
});
177177
});

0 commit comments

Comments
 (0)