Skip to content

Commit c14234a

Browse files
Rename scope facets (#2832)
Some scope facets had incorrect names Fixes #2826
1 parent f75b771 commit c14234a

File tree

8 files changed

+15
-13
lines changed

8 files changed

+15
-13
lines changed

packages/common/src/scopeSupportFacets/python.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = {
4848
"interior.switchCase": supported,
4949
"interior.ternary": supported,
5050
"interior.loop": supported,
51-
"interior.with": supported,
51+
"interior.resource": supported,
5252

5353
element: notApplicable,
5454
tags: notApplicable,

packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ export const scopeSupportFacetInfos: Record<
148148
description: "A constructor declaration in a class",
149149
scopeType: "namedFunction",
150150
},
151-
"namedFunction.iteration": {
152-
description: "Iteration scope for named functions",
151+
"namedFunction.iteration.block": {
152+
description:
153+
"Iteration scope for named functions. Statement blocks(body of functions/if classes/for loops/etc).",
153154
scopeType: "namedFunction",
154155
isIteration: true,
155156
},
@@ -180,8 +181,9 @@ export const scopeSupportFacetInfos: Record<
180181
description: "The name of a constructor in a class",
181182
scopeType: "functionName",
182183
},
183-
"functionName.iteration": {
184-
description: "Iteration scope for function names",
184+
"functionName.iteration.block": {
185+
description:
186+
"Iteration scope for function names. Statement blocks(body of functions/if classes/for loops/etc).",
185187
scopeType: "functionName",
186188
isIteration: true,
187189
},
@@ -749,8 +751,8 @@ export const scopeSupportFacetInfos: Record<
749751
description: "The body of an for/while loop",
750752
scopeType: { type: "interior" },
751753
},
752-
"interior.with": {
753-
description: "The body of an with/use/using statement",
754+
"interior.resource": {
755+
description: "the body of a 'with' / 'use' / 'using' statement",
754756
scopeType: { type: "interior" },
755757
},
756758

packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ export const scopeSupportFacets = [
3939
"anonymousFunction",
4040

4141
"namedFunction",
42-
"namedFunction.iteration",
42+
"namedFunction.iteration.block",
4343
"namedFunction.iteration.document",
4444
"namedFunction.method",
4545
"namedFunction.method.iteration.class",
4646
"namedFunction.constructor",
4747

4848
"functionName",
49-
"functionName.iteration",
49+
"functionName.iteration.block",
5050
"functionName.iteration.document",
5151
"functionName.method",
5252
"functionName.method.iteration.class",
@@ -185,7 +185,7 @@ export const scopeSupportFacets = [
185185
"interior.switchCase",
186186
"interior.ternary",
187187
"interior.loop",
188-
"interior.with",
188+
"interior.resource",
189189

190190
"notebookCell",
191191

packages/common/src/scopeSupportFacets/scss.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
88
export const scssScopeSupport: LanguageScopeSupportFacetMap = {
99
...cssScopeSupport,
1010

11-
"namedFunction.iteration": supported,
11+
"namedFunction.iteration.block": supported,
1212
"namedFunction.iteration.document": supported,
13-
"functionName.iteration": supported,
13+
"functionName.iteration.block": supported,
1414
"functionName.iteration.document": supported,
1515
"comment.line": supported,
1616
disqualifyDelimiter: supported,

packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For example, if you'd like to add support for the `namedFunction` facet of the `
3636
"namedFunction.method": supported,
3737
"namedFunction.method.iteration.class": supported,
3838
"namedFunction.constructor": supported,
39-
"namedFunction.iteration": supported,
39+
"namedFunction.iteration.block": supported,
4040
"namedFunction.iteration.document": supported,
4141
```
4242

0 commit comments

Comments
 (0)