From 2d9f7843eae2fe3f043673e94b9d6d6886009f7e Mon Sep 17 00:00:00 2001 From: Phil Cohen Date: Sat, 1 Feb 2025 14:19:16 -0800 Subject: [PATCH 1/5] Actions: attempt to validate PR description tests (#2810) GitHub includes the description comment when it formulates the commit message, which we don't want as it's pretty messy. We will ask users to remove the comment but we need to validate it before allowing merging. Stolen from https://github.com/orgs/community/discussions/84771#discussioncomment-8039595. --- .github/workflows/pr-description.yaml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pr-description.yaml diff --git a/.github/workflows/pr-description.yaml b/.github/workflows/pr-description.yaml new file mode 100644 index 0000000000..283638d811 --- /dev/null +++ b/.github/workflows/pr-description.yaml @@ -0,0 +1,30 @@ +name: PR Description + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + merge_group: + branches: [main] + +jobs: + validate-pr-description: + runs-on: ubuntu-latest + steps: + - name: Set up workspace + uses: actions/checkout@v2 + + - name: Validate description + run: | + # Fetch PR description from env with jq + PR_DESCRIPTION=$(jq -r ".pull_request.body" "$GITHUB_EVENT_PATH") + KEYWORD="REQUIRED_KEYWORD" + + # Ensure PR author removed the welcome comment + if [[ $PR_DESCRIPTION = *""* ]]; then + echo "FAILED: Please remove the welcome comment from your PR description." + exit 1 + else + echo "OK: Welcome comment is removed your PR description." + fi + + echo "PASS: All checks OK!" From ff3158576e052d87cfa685034fa17a215f397474 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 2 Feb 2025 01:24:07 +0100 Subject: [PATCH 2/5] Log fail test to file went running tests locally (#2809) The issue suggested showing a pop-up, but this wasn't optimal. It was either blocking the tests from terminating or it closed immediately by itself. I also don't want to clobber the clipboard all the time. Let's log to a file because it seems like the best of the options. Fixes #2805 --------- Co-authored-by: Phil Cohen --- .gitignore | 2 ++ .vscode/launch.json | 4 ++++ packages/test-harness/src/runAllTests.ts | 30 +++++++++++++++++------- packages/test-harness/src/testSubset.ts | 22 +++++++++++++++++ 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 064fef48ed..a227de4272 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,8 @@ next-env.d.ts # test subset config packages/test-harness/testSubsetGrep.properties +packages/test-harness/failedTests.properties + # cursorless-neovim cursorless.nvim/node/cursorless-neovim diff --git a/.vscode/launch.json b/.vscode/launch.json index 276b40d8fb..a7a87c13da 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -31,6 +31,7 @@ "request": "launch", "env": { "CURSORLESS_MODE": "test", + "CURSORLESS_LOG_FAILED": "true", "CURSORLESS_REPO_ROOT": "${workspaceFolder}" }, "args": [ @@ -52,6 +53,7 @@ "env": { "CURSORLESS_MODE": "test", "CURSORLESS_RUN_TEST_SUBSET": "true", + "CURSORLESS_LOG_FAILED": "true", "CURSORLESS_REPO_ROOT": "${workspaceFolder}" }, "args": [ @@ -136,6 +138,7 @@ "program": "${workspaceFolder}/packages/test-harness/dist/runTalonTests.cjs", "env": { "CURSORLESS_MODE": "test", + "CURSORLESS_LOG_FAILED": "true", "CURSORLESS_REPO_ROOT": "${workspaceFolder}" }, "outFiles": ["${workspaceFolder}/**/out/**/*.js"], @@ -171,6 +174,7 @@ "program": "${workspaceFolder}/packages/test-harness/dist/runTalonJsTests.cjs", "env": { "CURSORLESS_MODE": "test", + "CURSORLESS_LOG_FAILED": "true", "CURSORLESS_REPO_ROOT": "${workspaceFolder}" }, "outFiles": ["${workspaceFolder}/**/out/**/*.js"], diff --git a/packages/test-harness/src/runAllTests.ts b/packages/test-harness/src/runAllTests.ts index 3473980aa3..72061ae3de 100644 --- a/packages/test-harness/src/runAllTests.ts +++ b/packages/test-harness/src/runAllTests.ts @@ -1,8 +1,13 @@ -import Mocha from "mocha"; -import * as path from "node:path"; import { getCursorlessRepoRoot } from "@cursorless/node-common"; -import { runTestSubset, testSubsetGrepString } from "./testSubset"; import { glob } from "glob"; +import Mocha from "mocha"; +import * as path from "node:path"; +import { + logFailedTests, + runTestSubset, + shouldLogFailedTests, + testSubsetGrepString, +} from "./testSubset"; /** * Type of test to run, eg unit, vscode, talon @@ -24,7 +29,7 @@ export enum TestType { neovim, } -export function runAllTests(...types: TestType[]) { +export function runAllTests(...types: TestType[]): Promise { return runTestsInDir( path.join(getCursorlessRepoRoot(), "packages"), (files) => @@ -68,14 +73,23 @@ async function runTestsInDir( try { // Run the mocha test - await new Promise((c, e) => { - mocha.run((failures) => { + await new Promise((resolve, reject) => { + const failedTests: string[] = []; + + const runner = mocha.run((failures) => { if (failures > 0) { - e(new Error(`${failures} tests failed.`)); + if (shouldLogFailedTests()) { + logFailedTests(failedTests); + } + reject(`${failures} tests failed.`); } else { - c(); + resolve(); } }); + + if (shouldLogFailedTests()) { + runner.on("fail", (test) => failedTests.push(test.fullTitle())); + } }); } catch (err) { console.error(err); diff --git a/packages/test-harness/src/testSubset.ts b/packages/test-harness/src/testSubset.ts index 7782e2ad58..e3d106c446 100644 --- a/packages/test-harness/src/testSubset.ts +++ b/packages/test-harness/src/testSubset.ts @@ -29,6 +29,20 @@ export function testSubsetFilePath() { ); } +function testFailedFilePath() { + return path.join( + getCursorlessRepoRoot(), + "packages", + "test-harness", + "failedTests.properties", + ); +} + +export function logFailedTests(testNames: string[]) { + const lines = [`${testNames.length} failed tests`, "", ...testNames]; + fs.writeFileSync(testFailedFilePath(), lines.join("\n")); +} + /** * Determine whether we should run just the subset of the tests specified by * {@link TEST_SUBSET_GREP_STRING}. @@ -37,3 +51,11 @@ export function testSubsetFilePath() { export function runTestSubset() { return process.env.CURSORLESS_RUN_TEST_SUBSET === "true"; } + +/** + * Determine whether we should log the failed tests to a file. This makes it easier to put them in `testSubsetGrep.properties` for faster iterating. + * @returns `true` if we should log failed tests to `packages/test-harness/failedTests.properties` + */ +export function shouldLogFailedTests() { + return process.env.CURSORLESS_LOG_FAILED === "true"; +} From 6c12bc3471c7766f40f634691724e7b366666d6c Mon Sep 17 00:00:00 2001 From: Phil Cohen Date: Tue, 4 Feb 2025 09:42:24 -0800 Subject: [PATCH 3/5] ci: try upgrading corepack (#2816) `corepack@latest` is `corepack@0.31.0` which fixes the issue. Once this version is baked into the operating system image we use we can remove this override. Fixes https://github.com/cursorless-dev/cursorless/issues/2817 --- .github/workflows/deploy.yaml | 4 ++++ .github/workflows/pre-commit.yml | 4 ++++ .github/workflows/test-docs.yml | 4 ++++ .github/workflows/test.yml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index dead199a41..d651da25c9 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -20,6 +20,10 @@ jobs: with: fetch-depth: 0 + # FIXME: https://github.com/cursorless-dev/cursorless/issues/2817 + - name: Upgrade Corepack + run: npm install --global corepack@0.31.0 + - name: Enable Corepack run: corepack enable diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 2d158446be..2580f20c2a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -27,6 +27,10 @@ jobs: with: python-version: 3.x + # FIXME: https://github.com/cursorless-dev/cursorless/issues/2817 + - name: Upgrade Corepack + run: npm install --global corepack@0.31.0 + - name: Enable Corepack run: corepack enable diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 9485792020..2fb3091b84 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -16,6 +16,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + # FIXME: https://github.com/cursorless-dev/cursorless/issues/2817 + - name: Upgrade Corepack + run: npm install --global corepack@0.31.0 + - name: Enable Corepack run: corepack enable diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a15fa25f9..2981e8e932 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + # FIXME: https://github.com/cursorless-dev/cursorless/issues/2817 + - name: Upgrade Corepack + run: npm install --global --force corepack@0.31.0 + - name: Enable Corepack run: corepack enable From 8a81abe3a97a018fe351b37025920e2fb84e8c97 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 4 Feb 2025 19:10:16 +0100 Subject: [PATCH 4/5] Added interior scopes to python (#2814) ci fails because of: https://github.com/nodejs/corepack/issues/612 ## Release notes You can now use `"inside"` in Python loops and conditionals (`if`, `for`/`while`, `try`, etc). --- ...nterior.branch.scope => interior.if.scope} | 0 data/fixtures/scopes/python/interior.if.scope | 48 +++++++++++++ .../scopes/python/interior.loop.scope | 16 +++++ .../scopes/python/interior.loop2.scope | 16 +++++ .../scopes/python/interior.switchCase.scope | 62 +++++++++++++++++ .../scopes/python/interior.ternary.scope | 34 +++++++++ .../fixtures/scopes/python/interior.try.scope | 48 +++++++++++++ .../scopes/python/interior.try2.scope | 32 +++++++++ .../scopes/python/interior.with.scope | 16 +++++ packages/common/src/scopeSupportFacets/lua.ts | 2 +- .../common/src/scopeSupportFacets/python.ts | 6 ++ .../scopeSupportFacetInfos.ts | 34 +++++++-- .../scopeSupportFacets.types.ts | 7 +- queries/python.scm | 69 ++++++++++++------- 14 files changed, 355 insertions(+), 35 deletions(-) rename data/fixtures/scopes/lua/{interior.branch.scope => interior.if.scope} (100%) create mode 100644 data/fixtures/scopes/python/interior.if.scope create mode 100644 data/fixtures/scopes/python/interior.loop.scope create mode 100644 data/fixtures/scopes/python/interior.loop2.scope create mode 100644 data/fixtures/scopes/python/interior.switchCase.scope create mode 100644 data/fixtures/scopes/python/interior.ternary.scope create mode 100644 data/fixtures/scopes/python/interior.try.scope create mode 100644 data/fixtures/scopes/python/interior.try2.scope create mode 100644 data/fixtures/scopes/python/interior.with.scope diff --git a/data/fixtures/scopes/lua/interior.branch.scope b/data/fixtures/scopes/lua/interior.if.scope similarity index 100% rename from data/fixtures/scopes/lua/interior.branch.scope rename to data/fixtures/scopes/lua/interior.if.scope diff --git a/data/fixtures/scopes/python/interior.if.scope b/data/fixtures/scopes/python/interior.if.scope new file mode 100644 index 0000000000..1b902b0cab --- /dev/null +++ b/data/fixtures/scopes/python/interior.if.scope @@ -0,0 +1,48 @@ +if True: + a +elif False: + b +else: + c +--- + +[#1 Content] = +[#1 Removal] = 1:4-1:5 + >-< +1| a + +[#1 Domain] = 0:0-1:5 + >-------- +0| if True: +1| a + -----< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 3:4-3:5 + >-< +3| b + +[#2 Domain] = 2:0-3:5 + >----------- +2| elif False: +3| b + -----< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 5:4-5:5 + >-< +5| c + +[#3 Domain] = 4:0-5:5 + >----- +4| else: +5| c + -----< + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.loop.scope b/data/fixtures/scopes/python/interior.loop.scope new file mode 100644 index 0000000000..66c2c4a322 --- /dev/null +++ b/data/fixtures/scopes/python/interior.loop.scope @@ -0,0 +1,16 @@ +for v in values: + pass +--- + +[Content] = +[Removal] = 1:4-1:8 + >----< +1| pass + +[Domain] = 0:0-1:8 + >---------------- +0| for v in values: +1| pass + --------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.loop2.scope b/data/fixtures/scopes/python/interior.loop2.scope new file mode 100644 index 0000000000..606f604f49 --- /dev/null +++ b/data/fixtures/scopes/python/interior.loop2.scope @@ -0,0 +1,16 @@ +while True: + pass +--- + +[Content] = +[Removal] = 1:4-1:8 + >----< +1| pass + +[Domain] = 0:0-1:8 + >----------- +0| while True: +1| pass + --------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.switchCase.scope b/data/fixtures/scopes/python/interior.switchCase.scope new file mode 100644 index 0000000000..45502c3ade --- /dev/null +++ b/data/fixtures/scopes/python/interior.switchCase.scope @@ -0,0 +1,62 @@ +match value: + case 1: + a + case _: + b +--- + +[#1 Content] = 1:4-4:9 + >------- +1| case 1: +2| a +3| case _: +4| b + ---------< + +[#1 Removal] = 0:12-4:9 + > +0| match value: +1| case 1: +2| a +3| case _: +4| b + ---------< + +[#1 Domain] = 0:0-4:9 + >------------ +0| match value: +1| case 1: +2| a +3| case _: +4| b + ---------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:8-2:9 + >-< +2| a + +[#2 Domain] = 1:4-2:9 + >------- +1| case 1: +2| a + ---------< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 4:8-4:9 + >-< +4| b + +[#3 Domain] = 3:4-4:9 + >------- +3| case _: +4| b + ---------< + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.ternary.scope b/data/fixtures/scopes/python/interior.ternary.scope new file mode 100644 index 0000000000..fcd8355982 --- /dev/null +++ b/data/fixtures/scopes/python/interior.ternary.scope @@ -0,0 +1,34 @@ +1 if True else 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:1 + >-< +0| 1 if True else 0 + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:5-0:9 + >----< +0| 1 if True else 0 + +[#2 Domain] = 0:2-0:9 + >-------< +0| 1 if True else 0 + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:15-0:16 + >-< +0| 1 if True else 0 + +[#3 Domain] = 0:10-0:16 + >------< +0| 1 if True else 0 + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.try.scope b/data/fixtures/scopes/python/interior.try.scope new file mode 100644 index 0000000000..f84e164e81 --- /dev/null +++ b/data/fixtures/scopes/python/interior.try.scope @@ -0,0 +1,48 @@ +try: + a +except: + b +finally: + c +--- + +[#1 Content] = +[#1 Removal] = 1:4-1:5 + >-< +1| a + +[#1 Domain] = 0:0-1:5 + >---- +0| try: +1| a + -----< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 3:4-3:5 + >-< +3| b + +[#2 Domain] = 2:0-3:5 + >------- +2| except: +3| b + -----< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 5:4-5:5 + >-< +5| c + +[#3 Domain] = 4:0-5:5 + >-------- +4| finally: +5| c + -----< + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.try2.scope b/data/fixtures/scopes/python/interior.try2.scope new file mode 100644 index 0000000000..3514dad238 --- /dev/null +++ b/data/fixtures/scopes/python/interior.try2.scope @@ -0,0 +1,32 @@ +try: + a +except*: + b +--- + +[#1 Content] = +[#1 Removal] = 1:4-1:5 + >-< +1| a + +[#1 Domain] = 0:0-1:5 + >---- +0| try: +1| a + -----< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 3:4-3:5 + >-< +3| b + +[#2 Domain] = 2:0-3:5 + >-------- +2| except*: +3| b + -----< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.with.scope b/data/fixtures/scopes/python/interior.with.scope new file mode 100644 index 0000000000..f5cc28f2d3 --- /dev/null +++ b/data/fixtures/scopes/python/interior.with.scope @@ -0,0 +1,16 @@ +with file: + pass +--- + +[Content] = +[Removal] = 1:4-1:8 + >----< +1| pass + +[Domain] = 0:0-1:8 + >---------- +0| with file: +1| pass + --------< + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index 601d8c8d6d..2018d4cd54 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -16,5 +16,5 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { namedFunction: supported, disqualifyDelimiter: supported, "interior.function": supported, - "interior.branch": supported, + "interior.if": supported, }; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index b46466c93f..48f3410ea9 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -43,6 +43,12 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": supported, "interior.function": supported, "interior.lambda": supported, + "interior.if": supported, + "interior.try": supported, + "interior.switchCase": supported, + "interior.ternary": supported, + "interior.loop": supported, + "interior.with": supported, element: notApplicable, tags: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index f39280ee06..76b56e95bd 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -705,6 +705,18 @@ export const scopeSupportFacetInfos: Record< isIteration: true, }, + "interior.element": { + description: "The interior/children of an XML element", + scopeType: { type: "interior" }, + }, + "interior.command": { + description: "The body of a Talon command", + scopeType: { type: "interior" }, + }, + "interior.cell": { + description: "The body of a code cell in markdown", + scopeType: { type: "interior" }, + }, "interior.class": { description: "The body of a class", scopeType: { type: "interior" }, @@ -717,20 +729,28 @@ export const scopeSupportFacetInfos: Record< description: "The body of a lambda/anonymous function", scopeType: { type: "interior" }, }, - "interior.branch": { + "interior.if": { description: "The body of an if/elif/else branch", scopeType: { type: "interior" }, }, - "interior.element": { - description: "The interior/children of an XML element", + "interior.try": { + description: "The body of an try/catch/finally branch", scopeType: { type: "interior" }, }, - "interior.command": { - description: "The body of a Talon command", + "interior.switchCase": { + description: "The body of an switch case branch", scopeType: { type: "interior" }, }, - "interior.cell": { - description: "The body of a code cell in markdown", + "interior.ternary": { + description: "The body of an ternary condition/branch", + scopeType: { type: "interior" }, + }, + "interior.loop": { + description: "The body of an for/while loop", + scopeType: { type: "interior" }, + }, + "interior.with": { + description: "The body of an 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 e40b157f32..de802523cc 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -177,10 +177,15 @@ export const scopeSupportFacets = [ "interior.class", "interior.function", "interior.lambda", - "interior.branch", "interior.element", "interior.command", "interior.cell", + "interior.if", + "interior.try", + "interior.switchCase", + "interior.ternary", + "interior.loop", + "interior.with", "notebookCell", diff --git a/queries/python.scm b/queries/python.scm index 26ffbdc567..8251504013 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -156,6 +156,12 @@ (_) @value ) @_.domain +;;!! with aaa: +;;! ^^^ +(with_statement + body: (_) @interior +) @interior.domain + ;;!! with aaa: ;;! ^^^ ;;! -------- @@ -235,11 +241,9 @@ (#allow-multiple! @name) ) -( - (with_statement - (with_clause) @value.iteration @name.iteration - ) @value.iteration.domain @name.iteration.domain -) +(with_statement + (with_clause) @value.iteration @name.iteration +) @value.iteration.domain @name.iteration.domain ;;!! lambda str: len(str) > 0 ;;! ^^^^^^^^^^^^ @@ -369,6 +373,7 @@ ;;! ^^^^^ (match_statement subject: (_) @private.switchStatementSubject + body: (_) @interior ) @_.domain ;;!! { "value": 0 } @@ -394,6 +399,7 @@ (case_clause (case_pattern) @condition.start guard: (_)? @condition.end + consequence: (_) @interior ) @_.domain ;;!! case 0: pass @@ -407,17 +413,17 @@ ;;! ---------------- ( (conditional_expression - "if" + "if" @interior.domain.start . - (_) @condition - ) @_.domain + (_) @condition @interior @interior.domain.end + ) @condition.domain ) ;;!! 1 if True else 0 ;;! ^ ( (conditional_expression - (_) @branch + (_) @branch @interior . "if" ) @@ -427,9 +433,9 @@ ;;! ^ ( (conditional_expression - "else" + "else" @interior.domain.start . - (_) @branch + (_) @branch @interior @interior.domain.end ) ) @@ -456,37 +462,48 @@ ;;!! if True: pass ;;! ^^^^^^^^^^^^^ (if_statement - "if" @branch.start - consequence: (_) @branch.end + "if" @branch.start @interior.domain.start + consequence: (_) @branch.end @interior @interior.domain.end ) ;;!! elif True: pass ;;! ^^^^^^^^^^^^^^^ -(elif_clause) @branch +(elif_clause + consequence: (_) @interior +) @branch @interior.domain ;;!! else: pass ;;! ^^^^^^^^^^ -(else_clause) @branch +(else_clause + body: (_) @interior +) @branch @interior.domain (if_statement) @branch.iteration ;;!! try: pass ;;! ^^^^^^^^^ (try_statement - "try" @branch.start - body: (_) @branch.end + "try" @branch.start @interior.domain.start + body: (_) @branch.end @interior @interior.domain.end ) ;;!! except: pass ;;! ^^^^^^^^^^^^ -[ - (except_clause) - (except_group_clause) -] @branch +(except_clause + (block) @interior +) @branch @interior.domain + +;;!! except*: pass +;;! ^^^^^^^^^^^^^ +(except_group_clause + (block) @interior +) @branch @interior.domain ;;!! finally: pass ;;! ^^^^^^^^^^^^^ -(finally_clause) @branch +(finally_clause + (block) @interior +) @branch @interior.domain (try_statement) @branch.iteration @@ -494,8 +511,8 @@ ;;! ^^^^^^^^^^^^^^^^ (while_statement "while" @branch.start - body: (_) @branch.end -) + body: (_) @branch.end @interior +) @interior.domain (while_statement) @branch.iteration @@ -503,8 +520,8 @@ ;;! ^^^^^^^^^^^^^^^^^^^^ (for_statement "for" @branch.start - body: (_) @branch.end -) + body: (_) @branch.end @interior +) @interior.domain (for_statement) @branch.iteration From 0c941379cff48523d16d8b43dc1d3cfa0f0f7114 Mon Sep 17 00:00:00 2001 From: Phil Cohen Date: Tue, 4 Feb 2025 10:34:47 -0800 Subject: [PATCH 5/5] PULL_REQUEST_TEMPLATE.md: tell the user to remove the welcome comment (#2811) We're now validating in https://github.com/cursorless-dev/cursorless/pull/2810 that it is removed, so we should tell the person to remove it ## Release notes Co-authored-by: Andreas Arvidsson --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a0dfbb0f9a..b5e2a15233 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,8 +9,9 @@ Thanks for your change! * Remember to *test the cheatsheet manually* if you've added a new action, modifier, or scope -- or changed any Talon files. ---> +Remove this comment. +--> ## Release notes