mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
revert changes to classify a keyword as an identifier if the last token is keyword
This commit is contained in:
parent
ad9a87dfb6
commit
17c45ed986
@ -659,7 +659,6 @@ module ts {
|
||||
InMultiLineCommentTrivia,
|
||||
InSingleQuoteStringLiteral,
|
||||
InDoubleQuoteStringLiteral,
|
||||
EndingWithKeyword,
|
||||
EndingWithDotToken,
|
||||
}
|
||||
|
||||
@ -2243,9 +2242,6 @@ module ts {
|
||||
case EndOfLineState.EndingWithDotToken:
|
||||
lastToken = SyntaxKind.DotToken;
|
||||
break;
|
||||
case EndOfLineState.EndingWithKeyword:
|
||||
lastToken = SyntaxKind.FirstKeyword;
|
||||
break;
|
||||
}
|
||||
|
||||
var result: ClassificationResult = {
|
||||
@ -2264,7 +2260,7 @@ module ts {
|
||||
token = SyntaxKind.RegularExpressionLiteral;
|
||||
}
|
||||
}
|
||||
else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) {
|
||||
else if (lastToken === SyntaxKind.DotToken) {
|
||||
token = SyntaxKind.Identifier;
|
||||
}
|
||||
|
||||
@ -2316,9 +2312,6 @@ module ts {
|
||||
else if (token === SyntaxKind.DotToken) {
|
||||
result.finalLexState = EndOfLineState.EndingWithDotToken;
|
||||
}
|
||||
else if (isKeyword(token)) {
|
||||
result.finalLexState = EndOfLineState.EndingWithKeyword;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -222,16 +222,6 @@ describe('Colorization', function () {
|
||||
verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier);
|
||||
});
|
||||
|
||||
it("classifies keyword after a keyword", function () {
|
||||
var results = getClassifications("module string", ts.EndOfLineState.Start);
|
||||
verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier);
|
||||
});
|
||||
|
||||
it("reports correct state with a line ending in a keyword", function () {
|
||||
var results = getClassifications("module", ts.EndOfLineState.Start);
|
||||
assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword);
|
||||
});
|
||||
|
||||
it("classifies keyword after a dot on previous line", function () {
|
||||
var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user