diff --git a/data/fixtures/scopes/python/interior.with.scope b/data/fixtures/scopes/python/interior.resource.scope similarity index 100% rename from data/fixtures/scopes/python/interior.with.scope rename to data/fixtures/scopes/python/interior.resource.scope diff --git a/data/fixtures/scopes/scss/functionName.iteration.scope b/data/fixtures/scopes/scss/functionName.iteration.block.scope similarity index 100% rename from data/fixtures/scopes/scss/functionName.iteration.scope rename to data/fixtures/scopes/scss/functionName.iteration.block.scope diff --git a/data/fixtures/scopes/scss/namedFunction.iteration.scope b/data/fixtures/scopes/scss/namedFunction.iteration.block.scope similarity index 100% rename from data/fixtures/scopes/scss/namedFunction.iteration.scope rename to data/fixtures/scopes/scss/namedFunction.iteration.block.scope diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 48f3410ea9..6831b42d2f 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -48,7 +48,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "interior.switchCase": supported, "interior.ternary": supported, "interior.loop": supported, - "interior.with": supported, + "interior.resource": supported, element: notApplicable, tags: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 76b56e95bd..685b864cbd 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -148,8 +148,9 @@ export const scopeSupportFacetInfos: Record< description: "A constructor declaration in a class", scopeType: "namedFunction", }, - "namedFunction.iteration": { - description: "Iteration scope for named functions", + "namedFunction.iteration.block": { + description: + "Iteration scope for named functions. Statement blocks(body of functions/if classes/for loops/etc).", scopeType: "namedFunction", isIteration: true, }, @@ -180,8 +181,9 @@ export const scopeSupportFacetInfos: Record< description: "The name of a constructor in a class", scopeType: "functionName", }, - "functionName.iteration": { - description: "Iteration scope for function names", + "functionName.iteration.block": { + description: + "Iteration scope for function names. Statement blocks(body of functions/if classes/for loops/etc).", scopeType: "functionName", isIteration: true, }, @@ -749,8 +751,8 @@ export const scopeSupportFacetInfos: Record< description: "The body of an for/while loop", scopeType: { type: "interior" }, }, - "interior.with": { - description: "The body of an with/use/using statement", + "interior.resource": { + description: "the body of a 'with' / 'use' / 'using' statement", scopeType: { type: "interior" }, }, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index de802523cc..1e8807b7bb 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -39,14 +39,14 @@ export const scopeSupportFacets = [ "anonymousFunction", "namedFunction", - "namedFunction.iteration", + "namedFunction.iteration.block", "namedFunction.iteration.document", "namedFunction.method", "namedFunction.method.iteration.class", "namedFunction.constructor", "functionName", - "functionName.iteration", + "functionName.iteration.block", "functionName.iteration.document", "functionName.method", "functionName.method.iteration.class", @@ -185,7 +185,7 @@ export const scopeSupportFacets = [ "interior.switchCase", "interior.ternary", "interior.loop", - "interior.with", + "interior.resource", "notebookCell", diff --git a/packages/common/src/scopeSupportFacets/scss.ts b/packages/common/src/scopeSupportFacets/scss.ts index e5e00175a7..cad5192215 100644 --- a/packages/common/src/scopeSupportFacets/scss.ts +++ b/packages/common/src/scopeSupportFacets/scss.ts @@ -8,9 +8,9 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const scssScopeSupport: LanguageScopeSupportFacetMap = { ...cssScopeSupport, - "namedFunction.iteration": supported, + "namedFunction.iteration.block": supported, "namedFunction.iteration.document": supported, - "functionName.iteration": supported, + "functionName.iteration.block": supported, "functionName.iteration.document": supported, "comment.line": supported, disqualifyDelimiter: supported, diff --git a/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md b/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md index 9e86927821..fb9a7e44d4 100644 --- a/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md +++ b/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md @@ -36,7 +36,7 @@ For example, if you'd like to add support for the `namedFunction` facet of the ` "namedFunction.method": supported, "namedFunction.method.iteration.class": supported, "namedFunction.constructor": supported, - "namedFunction.iteration": supported, + "namedFunction.iteration.block": supported, "namedFunction.iteration.document": supported, ```