From f0e6f71b5c0530ed3c849d6aa4b06ac1056e17c7 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 6 Feb 2025 13:03:10 +0100 Subject: [PATCH 1/3] Rename resource --- .../python/{interior.with.scope => interior.resource.scope} | 0 packages/common/src/scopeSupportFacets/python.ts | 2 +- .../common/src/scopeSupportFacets/scopeSupportFacetInfos.ts | 4 ++-- .../common/src/scopeSupportFacets/scopeSupportFacets.types.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename data/fixtures/scopes/python/{interior.with.scope => interior.resource.scope} (100%) 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/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..89d36adcc3 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -749,8 +749,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..f1d82ebc93 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -185,7 +185,7 @@ export const scopeSupportFacets = [ "interior.switchCase", "interior.ternary", "interior.loop", - "interior.with", + "interior.resource", "notebookCell", From 974b49a43e9893eaa3ec7c3a18070d4a249e7f96 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 6 Feb 2025 13:05:48 +0100 Subject: [PATCH 2/3] Renamed named function iteration --- ...n.iteration.scope => namedFunction.iteration.block.scope} | 0 .../common/src/scopeSupportFacets/scopeSupportFacetInfos.ts | 5 +++-- .../src/scopeSupportFacets/scopeSupportFacets.types.ts | 2 +- packages/common/src/scopeSupportFacets/scss.ts | 2 +- .../src/docs/contributing/adding-a-new-scope.md | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) rename data/fixtures/scopes/scss/{namedFunction.iteration.scope => namedFunction.iteration.block.scope} (100%) 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/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 89d36adcc3..98a9ac9ff5 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, }, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index f1d82ebc93..24b441ec58 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -39,7 +39,7 @@ export const scopeSupportFacets = [ "anonymousFunction", "namedFunction", - "namedFunction.iteration", + "namedFunction.iteration.block", "namedFunction.iteration.document", "namedFunction.method", "namedFunction.method.iteration.class", diff --git a/packages/common/src/scopeSupportFacets/scss.ts b/packages/common/src/scopeSupportFacets/scss.ts index e5e00175a7..b87dd4b8be 100644 --- a/packages/common/src/scopeSupportFacets/scss.ts +++ b/packages/common/src/scopeSupportFacets/scss.ts @@ -8,7 +8,7 @@ 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.document": 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, ``` From 4be5630e3cb6549753a4603a15ad93f3175fe895 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 6 Feb 2025 13:07:51 +0100 Subject: [PATCH 3/3] Renamed function name iteration --- ...me.iteration.scope => functionName.iteration.block.scope} | 0 .../common/src/scopeSupportFacets/scopeSupportFacetInfos.ts | 5 +++-- .../src/scopeSupportFacets/scopeSupportFacets.types.ts | 2 +- packages/common/src/scopeSupportFacets/scss.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename data/fixtures/scopes/scss/{functionName.iteration.scope => functionName.iteration.block.scope} (100%) 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/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 98a9ac9ff5..685b864cbd 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -181,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, }, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 24b441ec58..1e8807b7bb 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -46,7 +46,7 @@ export const scopeSupportFacets = [ "namedFunction.constructor", "functionName", - "functionName.iteration", + "functionName.iteration.block", "functionName.iteration.document", "functionName.method", "functionName.method.iteration.class", diff --git a/packages/common/src/scopeSupportFacets/scss.ts b/packages/common/src/scopeSupportFacets/scss.ts index b87dd4b8be..cad5192215 100644 --- a/packages/common/src/scopeSupportFacets/scss.ts +++ b/packages/common/src/scopeSupportFacets/scss.ts @@ -10,7 +10,7 @@ export const scssScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": supported, "namedFunction.iteration.document": supported, - "functionName.iteration": supported, + "functionName.iteration.block": supported, "functionName.iteration.document": supported, "comment.line": supported, disqualifyDelimiter: supported,