Skip to content

Commit

Permalink
C#: Migrate class scope (#2332)
Browse files Browse the repository at this point in the history
## Checklist

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: Andrew Dant <andrew.dant@clario.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored May 15, 2024
1 parent bccc6d8 commit f143950
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"jrieken.vscode-tree-sitter-query",
"wenkokke.tree-sitter-talon"
"wenkokke.tree-sitter-talon",
"usernamehw.commands"
]
}
10 changes: 10 additions & 0 deletions data/fixtures/scopes/csharp/class.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public class BankAccount {}
---

[Content] =
[Removal] =
[Domain] = 0:0-0:27
>---------------------------<
0| public class BankAccount {}

[Insertion delimiter] = "\n\n"
1 change: 1 addition & 0 deletions packages/common/src/scopeSupportFacets/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;

export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
ifStatement: supported,
class: supported,
};
1 change: 0 additions & 1 deletion packages/cursorless-engine/src/languages/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ const nodeMatchers: Partial<
Record<SimpleScopeTypeType, NodeMatcherAlternative>
> = {
...getMapMatchers,
class: "class_declaration",
className: "class_declaration[name]",
condition: cascadingMatcher(
conditionMatcher("*[condition]"),
Expand Down
1 change: 1 addition & 0 deletions queries/csharp.scm
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
(if_statement) @ifStatement
(class_declaration) @class

0 comments on commit f143950

Please sign in to comment.