mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 02:46:15 -05:00
Do not colorize a keyword following an identifier.<newLine> as it is likely an error scenario as the user is typing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user