mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
revert changes to classify a keyword as an identifier if the last token is keyword
This commit is contained in:
@@ -659,7 +659,6 @@ module ts {
|
||||
InMultiLineCommentTrivia,
|
||||
InSingleQuoteStringLiteral,
|
||||
InDoubleQuoteStringLiteral,
|
||||
EndingWithKeyword,
|
||||
EndingWithDotToken,
|
||||
}
|
||||
|
||||
@@ -2243,9 +2242,6 @@ module ts {
|
||||
//
|
||||
// If we're in a multiline comment, then prepend: /*
|
||||
// (and a newline). That way when we lex we'll think we're still in a multiline comment.
|
||||
switch (lexState) {
|
||||
case EndOfLineState.InDoubleQuoteStringLiteral:
|
||||
text = '"\\\n' + text;
|
||||
switch (lexState) {
|
||||
case EndOfLineState.InDoubleQuoteStringLiteral:
|
||||
text = '"\\\n' + text;
|
||||
@@ -2264,7 +2260,7 @@ module ts {
|
||||
break;
|
||||
}
|
||||
|
||||
var result: ClassificationResult = {
|
||||
var result: ClassificationResult = {
|
||||
finalLexState: EndOfLineState.Start,
|
||||
entries: []
|
||||
};
|
||||
@@ -2316,9 +2312,6 @@ module ts {
|
||||
addResult(end - start, classFromKind(token));
|
||||
|
||||
if (end >= text.length) {
|
||||
// We're at the end.
|
||||
if (inUnterminatedMultiLineComment) {
|
||||
result.finalLexState = EndOfLineState.InMultiLineCommentTrivia;
|
||||
// We're at the end.
|
||||
if (inUnterminatedMultiLineComment) {
|
||||
result.finalLexState = EndOfLineState.InMultiLineCommentTrivia;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user