Skip to content

Commit

Permalink
Use the faster implmentation of the 2020 syntaxtical classifications
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Oct 5, 2020
1 parent 23cb2d8 commit 4dcce0f
Show file tree
Hide file tree
Showing 8 changed files with 1,859 additions and 162 deletions.
1,990 changes: 1,843 additions & 147 deletions src/services/classifier2020.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ verify.semanticClassificationsAre("original",
const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("class.declaration", "x"),
c2.semanticToken("class", "C"),
c2.semanticToken("class.declaration", "C"),
c2.semanticToken("class.declaration", "C"),
c2.semanticToken("class.declaration", "D"),
c2.semanticToken("class", "B"),
c2.semanticToken("class.declaration", "B"),
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ verify.semanticClassificationsAre("original",
c.moduleName("M", test.marker("0").position),
c.interfaceName("I", test.marker("1").position));



const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable", "M"),
c2.semanticToken("namespace.declaration", "M"),
c2.semanticToken("interface.declaration", "I"),
c2.semanticToken("variable.declaration", "M"),
c2.semanticToken("property.declaration", "I"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ verify.semanticClassificationsAre("original",

const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable", "M"),
c2.semanticToken("namespace.declaration", "M"),
c2.semanticToken("interface.declaration", "I"),
c2.semanticToken("variable.declaration", "M"),
c2.semanticToken("property.declaration", "foo"),
Expand All @@ -34,4 +34,3 @@ verify.semanticClassificationsAre("2020",
c2.semanticToken("variable.declaration", "x"),
c2.semanticToken("variable", "M"),
);

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ verify.semanticClassificationsAre("original",

const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable", "M"),
c2.semanticToken("namespace.declaration", "M"),
c2.semanticToken("interface.declaration", "I"),
c2.semanticToken("interface.declaration", "I"),
c2.semanticToken("class.declaration", "C"),
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/fourslash/syntacticClassificationsForOfKeyword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ verify.syntacticClassificationsAre(

const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable.declaration", "of"),
c2.semanticToken("variable", "of"),
c2.semanticToken("variable.declaration.local", "of"),
c2.semanticToken("variable.local", "of"),
);
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ verify.syntacticClassificationsAre(
c.punctuation("}")
);

const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable.declaration", "of"),
c2.semanticToken("variable", "of"),
const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable.declaration.local", "of"),
c2.semanticToken("variable.local", "of"),
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ verify.syntacticClassificationsAre(

const c2 = classification("2020");
verify.semanticClassificationsAre("2020",
c2.semanticToken("variable.declaration", "of"),
c2.semanticToken("variable", "of"),
c2.semanticToken("variable", "of"),
c2.semanticToken("variable.declaration.local", "of"),
c2.semanticToken("variable.local", "of"),
c2.semanticToken("variable.local", "of"),
);

0 comments on commit 4dcce0f

Please sign in to comment.