Skip to content

Commit

Permalink
csharp migrate classname
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDant committed May 19, 2024
1 parent 2b6475e commit 3a98ae3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
21 changes: 21 additions & 0 deletions data/fixtures/scopes/csharp/className.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public class BankAccount {}
---

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

[Removal] = 0:13-0:25
>------------<
0| public class BankAccount {}

[Leading delimiter] = 0:12-0:13
>-<
0| public class BankAccount {}

[Trailing delimiter] = 0:24-0:25
>-<
0| public class BankAccount {}

[Insertion delimiter] = " "
1 change: 1 addition & 0 deletions packages/common/src/scopeSupportFacets/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
ifStatement: supported,
class: supported,
className: 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 @@ -139,7 +139,6 @@ const nodeMatchers: Partial<
Record<SimpleScopeTypeType, NodeMatcherAlternative>
> = {
...getMapMatchers,
className: "class_declaration[name]",
condition: cascadingMatcher(
conditionMatcher("*[condition]"),
patternMatcher("while_statement[0]"),
Expand Down
3 changes: 2 additions & 1 deletion queries/csharp.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(if_statement) @ifStatement
(class_declaration) @class
(class_declaration
name: (identifier) @className) @class
(
(string_literal) @string @textFragment
(#child-range! @textFragment 0 -1 true true)
Expand Down

0 comments on commit 3a98ae3

Please sign in to comment.