revert changes to classify a keyword as an identifier if the last token is keyword

This commit is contained in:
Mohamed Hegazy
2014-08-08 16:43:31 -07:00
parent ad9a87dfb6
commit 17c45ed986
2 changed files with 1 additions and 18 deletions

View File

@@ -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;

View File

@@ -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);