Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the faster implmentation of the 2020 syntaxtical classifications #40949

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"),
);