Skip to content

Commit bb53c38

Browse files
Merge pull request microsoft#3850 from Microsoft/textClassification
Classify Identifiers as 'Identifier', not 'Text'.
2 parents 7664f34 + 7850974 commit bb53c38

16 files changed

+37
-37
lines changed

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6575,7 +6575,7 @@ namespace ts {
65756575
}
65766576
}
65776577

6578-
return ClassificationType.text;
6578+
return ClassificationType.identifier;
65796579
}
65806580
}
65816581

tests/cases/fourslash/shims/getSyntacticClassifications.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ var c = classification;
2222
verify.syntacticClassificationsAre(
2323
c.comment("// comment"),
2424
c.keyword("module"), c.moduleName("M"), c.punctuation("{"),
25-
c.keyword("var"), c.text("v"), c.operator("="), c.numericLiteral("0"), c.operator("+"), c.numericLiteral("1"), c.punctuation(";"),
26-
c.keyword("var"), c.text("s"), c.operator("="), c.stringLiteral('"string"'), c.punctuation(";"),
25+
c.keyword("var"), c.identifier("v"), c.operator("="), c.numericLiteral("0"), c.operator("+"), c.numericLiteral("1"), c.punctuation(";"),
26+
c.keyword("var"), c.identifier("s"), c.operator("="), c.stringLiteral('"string"'), c.punctuation(";"),
2727
c.keyword("class"), c.className("C"), c.punctuation("<"), c.typeParameterName("T"), c.punctuation(">"), c.punctuation("{"),
2828
c.punctuation("}"),
2929
c.keyword("enum"), c.enumName("E"), c.punctuation("{"),

tests/cases/fourslash/syntacticClassificationWithErrors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
let c = classification
99
verify.syntacticClassificationsAre(
1010
c.keyword("class"), c.className("A"), c.punctuation("{"),
11-
c.text("a"), c.punctuation(":"),
11+
c.identifier("a"), c.punctuation(":"),
1212
c.punctuation("}"),
13-
c.text("c"), c.operator("=")
13+
c.identifier("c"), c.operator("=")
1414
);

tests/cases/fourslash/syntacticClassifications1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ var c = classification;
2222
verify.syntacticClassificationsAre(
2323
c.comment("// comment"),
2424
c.keyword("module"), c.moduleName("M"), c.punctuation("{"),
25-
c.keyword("var"), c.text("v"), c.operator("="), c.numericLiteral("0"), c.operator("+"), c.numericLiteral("1"), c.punctuation(";"),
26-
c.keyword("var"), c.text("s"), c.operator("="), c.stringLiteral('"string"'), c.punctuation(";"),
25+
c.keyword("var"), c.identifier("v"), c.operator("="), c.numericLiteral("0"), c.operator("+"), c.numericLiteral("1"), c.punctuation(";"),
26+
c.keyword("var"), c.identifier("s"), c.operator("="), c.stringLiteral('"string"'), c.punctuation(";"),
2727
c.keyword("class"), c.className("C"), c.punctuation("<"), c.typeParameterName("T"), c.punctuation(">"), c.punctuation("{"),
2828
c.punctuation("}"),
2929
c.keyword("enum"), c.enumName("E"), c.punctuation("{"),

tests/cases/fourslash/syntacticClassificationsConflictMarkers1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ var c = classification;
1212
verify.syntacticClassificationsAre(
1313
c.keyword("class"), c.className("C"), c.punctuation("{"),
1414
c.comment("<<<<<<< HEAD"),
15-
c.text("v"), c.operator("="), c.numericLiteral("1"), c.punctuation(";"),
15+
c.identifier("v"), c.operator("="), c.numericLiteral("1"), c.punctuation(";"),
1616
c.comment("======="),
17-
c.text("v"), c.punctuation("="), c.numericLiteral("2"), c.punctuation(";"),
17+
c.identifier("v"), c.punctuation("="), c.numericLiteral("2"), c.punctuation(";"),
1818
c.comment(">>>>>>> Branch - a"),
1919
c.punctuation("}"));

tests/cases/fourslash/syntacticClassificationsConflictMarkers2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ verify.syntacticClassificationsAre(
1111
c.comment("<<<<<<< HEAD"),
1212
c.keyword("class"), c.className("C"), c.punctuation("{"), c.punctuation("}"),
1313
c.comment("======="),
14-
c.keyword("class"), c.text("D"), c.punctuation("{"), c.punctuation("}"),
14+
c.keyword("class"), c.identifier("D"), c.punctuation("{"), c.punctuation("}"),
1515
c.comment(">>>>>>> Branch - a"));

tests/cases/fourslash/syntacticClassificationsDocComment1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ verify.syntacticClassificationsAre(
1313
c.punctuation("}"),
1414
c.comment(" */"),
1515
c.keyword("var"),
16-
c.text("v"),
16+
c.identifier("v"),
1717
c.punctuation(";"));

tests/cases/fourslash/syntacticClassificationsDocComment2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ verify.syntacticClassificationsAre(
1515
c.punctuation("{"),
1616
c.keyword("function"),
1717
c.punctuation("("),
18-
c.text("x"),
18+
c.identifier("x"),
1919
c.punctuation(")"),
2020
c.punctuation(":"),
2121
c.keyword("string"),
2222
c.punctuation("}"),
2323
c.comment(" */"),
2424
c.keyword("var"),
25-
c.text("v"),
25+
c.identifier("v"),
2626
c.punctuation(";"));

tests/cases/fourslash/syntacticClassificationsDocComment3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ verify.syntacticClassificationsAre(
1515
c.keyword("number"),
1616
c.comment(" /* } */"),
1717
c.keyword("var"),
18-
c.text("v"),
18+
c.identifier("v"),
1919
c.punctuation(";"));

tests/cases/fourslash/syntacticClassificationsForOfKeyword.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ verify.syntacticClassificationsAre(
77
c.keyword("for"),
88
c.punctuation("("),
99
c.keyword("var"),
10-
c.text("of"),
10+
c.identifier("of"),
1111
c.keyword("of"),
12-
c.text("of"),
12+
c.identifier("of"),
1313
c.punctuation(")"),
1414
c.punctuation("{"),
1515
c.punctuation("}")

0 commit comments

Comments
 (0)