From b650b22d3d27f2d9976a8f51864079cec7e3cc93 Mon Sep 17 00:00:00 2001 From: fidgetingbits Date: Mon, 17 Jun 2024 11:15:53 +0800 Subject: [PATCH 01/26] initial next-gen shellscript support --- .../languages/shellscript/changeArg.yml | 23 ++ .../languages/shellscript/changeArg2.yml | 23 ++ .../languages/shellscript/changeArg3.yml | 23 ++ .../languages/shellscript/changeArg4.yml | 23 ++ .../languages/shellscript/changeArg5.yml | 25 ++ .../languages/shellscript/changeArgBat.yml | 29 ++ .../languages/shellscript/changeArgRed.yml | 29 ++ .../languages/shellscript/changeBranch.yml | 31 ++ .../languages/shellscript/changeBranch2.yml | 35 ++ .../languages/shellscript/changeBranch3.yml | 31 ++ .../languages/shellscript/changeBranch4.yml | 31 ++ .../languages/shellscript/changeBranch5.yml | 31 ++ .../languages/shellscript/changeBranch6.yml | 31 ++ .../languages/shellscript/changeBranch7.yml | 45 +++ .../languages/shellscript/changeCall.yml | 23 ++ .../languages/shellscript/changeCallee.yml | 23 ++ .../languages/shellscript/changeCommand.yml | 23 ++ .../languages/shellscript/changeComment.yml | 23 ++ .../languages/shellscript/changeCondition.yml | 33 ++ .../shellscript/changeCondition2.yml | 39 +++ .../shellscript/changeCondition3.yml | 47 +++ .../shellscript/changeConditionEach.yml | 37 +++ .../shellscript/changeConditionFive.yml | 35 ++ .../languages/shellscript/changeEveryArg.yml | 27 ++ .../shellscript/changeEveryArgInsideFine.yml | 32 ++ .../shellscript/changeEveryArgInsideFine2.yml | 32 ++ .../shellscript/changeEveryArgInsideTrap.yml | 32 ++ .../shellscript/changeEveryArgInsideTrap2.yml | 32 ++ .../shellscript/changeEveryBranch.yml | 35 ++ .../languages/shellscript/changeEveryItem.yml | 29 ++ .../languages/shellscript/changeFunk.yml | 26 ++ .../languages/shellscript/changeFunkName.yml | 29 ++ .../languages/shellscript/changeIfState.yml | 28 ++ .../languages/shellscript/changeInside.yml | 22 ++ .../languages/shellscript/changeInside2.yml | 22 ++ .../shellscript/changeInsideBranch.yml | 34 ++ .../shellscript/changeInsideBranch2.yml | 38 +++ .../shellscript/changeInsideBranch3.yml | 33 ++ .../shellscript/changeInsideBranch4.yml | 43 +++ .../shellscript/changeInsideBranch5.yml | 42 +++ .../shellscript/changeInsideBranch6.yml | 45 +++ .../shellscript/changeInsideBranch7.yml | 44 +++ .../shellscript/changeInsideBranch8.yml | 48 +++ .../shellscript/changeInsideEveryBranch.yml | 43 +++ .../shellscript/changeInsideEveryBranch2.yml | 47 +++ .../shellscript/changeInsideEveryBranch3.yml | 52 +++ .../shellscript/changeInsideFirstBranch.yml | 36 ++ .../shellscript/changeInsideFunk.yml | 30 ++ .../shellscript/changeInsideList.yml | 24 ++ .../languages/shellscript/changeKeyCrunch.yml | 33 ++ .../languages/shellscript/changeList.yml | 23 ++ .../languages/shellscript/changeName.yml | 23 ++ .../languages/shellscript/changeName2.yml | 27 ++ .../languages/shellscript/changeName3.yml | 29 ++ .../languages/shellscript/changeRegexZero.yml | 41 +++ .../languages/shellscript/changeState.yml | 23 ++ .../languages/shellscript/changeState2.yml | 23 ++ .../languages/shellscript/changeState3.yml | 23 ++ .../languages/shellscript/changeString.yml | 23 ++ .../languages/shellscript/changeValue.yml | 23 ++ .../languages/shellscript/changeValueOne.yml | 35 ++ .../languages/shellscript/changeValueVest.yml | 33 ++ .../languages/shellscript/chuckArg.yml | 23 ++ .../languages/shellscript/chuckArg2.yml | 23 ++ .../languages/shellscript/chuckArgZip.yml | 29 ++ .../shellscript/chuckInsideBranch.yml | 47 +++ .../languages/shellscript/chuckItem.yml | 25 ++ .../languages/shellscript/chuckItem2.yml | 25 ++ .../languages/shellscript/chuckName.yml | 23 ++ .../shellscript/chuckNameGreenSit.yml | 35 ++ .../languages/shellscript/chuckValue.yml | 23 ++ .../languages/shellscript/chuckValue2.yml | 25 ++ .../languages/shellscript/chuckValueOne.yml | 35 ++ .../fixtures/scopes/shellscript/command.scope | 10 + data/fixtures/scopes/shellscript/list.scope | 10 + .../scopes/shellscript/name.assignment.scope | 20 ++ .../scopes/shellscript/name.assignment2.scope | 20 ++ .../scopes/shellscript/name.assignment3.scope | 20 ++ .../scopes/shellscript/value.assignment.scope | 20 ++ data/fixtures/subtoken.fixture.ts | 87 +++++ data/playground/shellscript/shellscript.sh | 172 ++++++++++ .../languageScopeSupport.ts | 2 + .../src/scopeSupportFacets/shellscript.ts | 15 + queries/shellscript.scm | 311 ++++++++++++++++++ 84 files changed, 2957 insertions(+) create mode 100644 data/fixtures/recorded/languages/shellscript/changeArg.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeArg2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeArg3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeArg4.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeArg5.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeArgBat.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeArgRed.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch4.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch5.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch6.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeBranch7.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeCall.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeCallee.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeCommand.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeComment.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeCondition.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeCondition2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeCondition3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeConditionEach.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeConditionFive.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryArg.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryBranch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeEveryItem.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeFunk.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeFunkName.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeIfState.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInside.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInside2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideFunk.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeInsideList.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeList.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeName.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeName2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeName3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeRegexZero.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeState.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeState2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeState3.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeString.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeValue.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeValueOne.yml create mode 100644 data/fixtures/recorded/languages/shellscript/changeValueVest.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckArg.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckArg2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckArgZip.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckInsideBranch.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckItem.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckItem2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckName.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckNameGreenSit.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckValue.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckValue2.yml create mode 100644 data/fixtures/recorded/languages/shellscript/chuckValueOne.yml create mode 100644 data/fixtures/scopes/shellscript/command.scope create mode 100644 data/fixtures/scopes/shellscript/list.scope create mode 100644 data/fixtures/scopes/shellscript/name.assignment.scope create mode 100644 data/fixtures/scopes/shellscript/name.assignment2.scope create mode 100644 data/fixtures/scopes/shellscript/name.assignment3.scope create mode 100644 data/fixtures/scopes/shellscript/value.assignment.scope create mode 100644 data/fixtures/subtoken.fixture.ts create mode 100755 data/playground/shellscript/shellscript.sh create mode 100644 packages/common/src/scopeSupportFacets/shellscript.ts create mode 100644 queries/shellscript.scm diff --git a/data/fixtures/recorded/languages/shellscript/changeArg.yml b/data/fixtures/recorded/languages/shellscript/changeArg.yml new file mode 100644 index 00000000000..dd3d7864687 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArg.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: var="foo ${bar}" + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: {} +finalState: + documentContents: var="foo " + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} diff --git a/data/fixtures/recorded/languages/shellscript/changeArg2.yml b/data/fixtures/recorded/languages/shellscript/changeArg2.yml new file mode 100644 index 00000000000..784d5d5a76d --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArg2.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: var="foo $bar" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: var="foo " + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} diff --git a/data/fixtures/recorded/languages/shellscript/changeArg3.yml b/data/fixtures/recorded/languages/shellscript/changeArg3.yml new file mode 100644 index 00000000000..c57d0c9088f --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArg3.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: echo "foo" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "echo " + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} diff --git a/data/fixtures/recorded/languages/shellscript/changeArg4.yml b/data/fixtures/recorded/languages/shellscript/changeArg4.yml new file mode 100644 index 00000000000..adcae9517bc --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArg4.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: echo "foo" "bar" + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: {} +finalState: + documentContents: "echo \"foo\" " + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} diff --git a/data/fixtures/recorded/languages/shellscript/changeArg5.yml b/data/fixtures/recorded/languages/shellscript/changeArg5.yml new file mode 100644 index 00000000000..1fcae07e876 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArg5.yml @@ -0,0 +1,25 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Foo ${BAR}" + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: | + echo "Foo " + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} diff --git a/data/fixtures/recorded/languages/shellscript/changeArgBat.yml b/data/fixtures/recorded/languages/shellscript/changeArgBat.yml new file mode 100644 index 00000000000..13834d9ec30 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArgBat.yml @@ -0,0 +1,29 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg bat + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: b} + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Foo ${BAR} ${BAZ} bar" + selections: + - anchor: {line: 0, character: 28} + active: {line: 0, character: 28} + marks: + default.b: + start: {line: 0, character: 12} + end: {line: 0, character: 15} +finalState: + documentContents: | + echo "Foo ${BAZ} bar" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} diff --git a/data/fixtures/recorded/languages/shellscript/changeArgRed.yml b/data/fixtures/recorded/languages/shellscript/changeArgRed.yml new file mode 100644 index 00000000000..a83ac5f9a65 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeArgRed.yml @@ -0,0 +1,29 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change arg red + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: r} + modifiers: + - type: containingScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Foo $BAR as $BAZ" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: + default.r: + start: {line: 0, character: 11} + end: {line: 0, character: 14} +finalState: + documentContents: | + echo "Foo as $BAZ" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch.yml b/data/fixtures/recorded/languages/shellscript/changeBranch.yml new file mode 100644 index 00000000000..3152de1f4dc --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch.yml @@ -0,0 +1,31 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 3, character: 10} + active: {line: 3, character: 10} + marks: {} +finalState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + fi + selections: + - anchor: {line: 2, character: 0} + active: {line: 2, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch2.yml b/data/fixtures/recorded/languages/shellscript/changeBranch2.yml new file mode 100644 index 00000000000..9b7b1c57e37 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch2.yml @@ -0,0 +1,35 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + elif [ "$number" -gt 42 ]; then + echo "The number is greater than 42" + else + echo "The number is less than than 42" + fi + selections: + - anchor: {line: 3, character: 10} + active: {line: 3, character: 10} + marks: {} +finalState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + echo "The number is less than than 42" + fi + selections: + - anchor: {line: 2, character: 0} + active: {line: 2, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch3.yml b/data/fixtures/recorded/languages/shellscript/changeBranch3.yml new file mode 100644 index 00000000000..1b13c1718e6 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch3.yml @@ -0,0 +1,31 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + fi + + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: |+ + + fi + + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch4.yml b/data/fixtures/recorded/languages/shellscript/changeBranch4.yml new file mode 100644 index 00000000000..b422d8f65ac --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch4.yml @@ -0,0 +1,31 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + else + fi + + selections: + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + + fi + + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch5.yml b/data/fixtures/recorded/languages/shellscript/changeBranch5.yml new file mode 100644 index 00000000000..80923898927 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch5.yml @@ -0,0 +1,31 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + else + fi + + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: |+ + + else + fi + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch6.yml b/data/fixtures/recorded/languages/shellscript/changeBranch6.yml new file mode 100644 index 00000000000..c0703b6ef3e --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch6.yml @@ -0,0 +1,31 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: | + if [ $value -le 0 ]; then + elif [ $value -le 0 ]; then + else + fi + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + marks: {} +finalState: + documentContents: | + if [ $value -le 0 ]; then + + else + fi + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeBranch7.yml b/data/fixtures/recorded/languages/shellscript/changeBranch7.yml new file mode 100644 index 00000000000..8225b8c671f --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeBranch7.yml @@ -0,0 +1,45 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: | + # Case statement + case "$number" in + 1) + echo "Number is 1" + ;; + 2) + echo "Number is 2" + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} + marks: {} +finalState: + documentContents: | + # Case statement + case "$number" in + + 2) + echo "Number is 2" + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 2, character: 0} + active: {line: 2, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeCall.yml b/data/fixtures/recorded/languages/shellscript/changeCall.yml new file mode 100644 index 00000000000..f6695695135 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeCall.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change call + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: functionCall} + usePrePhraseSnapshot: true +initialState: + documentContents: echo "foo" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeCallee.yml b/data/fixtures/recorded/languages/shellscript/changeCallee.yml new file mode 100644 index 00000000000..e2518f8f5c9 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeCallee.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change callee + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: functionCallee} + usePrePhraseSnapshot: true +initialState: + documentContents: echo "foo" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: " \"foo\"" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeCommand.yml b/data/fixtures/recorded/languages/shellscript/changeCommand.yml new file mode 100644 index 00000000000..b1fcd5b055c --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeCommand.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change command + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: command} + usePrePhraseSnapshot: true +initialState: + documentContents: ls non_existent_file || echo "File not found" + selections: + - anchor: {line: 0, character: 26} + active: {line: 0, character: 26} + marks: {} +finalState: + documentContents: "ls non_existent_file || " + selections: + - anchor: {line: 0, character: 24} + active: {line: 0, character: 24} diff --git a/data/fixtures/recorded/languages/shellscript/changeComment.yml b/data/fixtures/recorded/languages/shellscript/changeComment.yml new file mode 100644 index 00000000000..c95882fe57b --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeComment.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change comment + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: comment} + usePrePhraseSnapshot: true +initialState: + documentContents: "# foo" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeCondition.yml b/data/fixtures/recorded/languages/shellscript/changeCondition.yml new file mode 100644 index 00000000000..cddbd5978e4 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeCondition.yml @@ -0,0 +1,33 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change condition + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: condition} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: |- + if ; then + echo "The number is 42" + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} diff --git a/data/fixtures/recorded/languages/shellscript/changeCondition2.yml b/data/fixtures/recorded/languages/shellscript/changeCondition2.yml new file mode 100644 index 00000000000..c86baf27d8b --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeCondition2.yml @@ -0,0 +1,39 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change condition + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: condition} + usePrePhraseSnapshot: true +initialState: + documentContents: | + + if [["$number" -eq 42 ]]; then + echo "number match" + elif [[ $number -lt 20 ]]; then + echo "< 20" + else + echo "No match" + fi + selections: + - anchor: {line: 4, character: 6} + active: {line: 4, character: 6} + marks: {} +finalState: + documentContents: | + + if [["$number" -eq 42 ]]; then + echo "number match" + elif ; then + echo "< 20" + else + echo "No match" + fi + selections: + - anchor: {line: 3, character: 5} + active: {line: 3, character: 5} diff --git a/data/fixtures/recorded/languages/shellscript/changeCondition3.yml b/data/fixtures/recorded/languages/shellscript/changeCondition3.yml new file mode 100644 index 00000000000..11880bdc830 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeCondition3.yml @@ -0,0 +1,47 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change condition + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: condition} + usePrePhraseSnapshot: true +initialState: + documentContents: | + # Case statement + case "$number" in + 1) + echo "Number is 1" + ;; + 2) + echo "Number is 2" + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 3, character: 9} + active: {line: 3, character: 9} + marks: {} +finalState: + documentContents: | + # Case statement + case "$number" in + ) + echo "Number is 1" + ;; + 2) + echo "Number is 2" + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 2, character: 0} + active: {line: 2, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeConditionEach.yml b/data/fixtures/recorded/languages/shellscript/changeConditionEach.yml new file mode 100644 index 00000000000..dfbdf5cb14b --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeConditionEach.yml @@ -0,0 +1,37 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change condition each + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: e} + modifiers: + - type: containingScope + scopeType: {type: condition} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + until [ $counter -gt 5 ] + do + echo "Iteration: $counter" + ((counter++)) + done + selections: + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} + marks: + default.e: + start: {line: 0, character: 9} + end: {line: 0, character: 16} +finalState: + documentContents: |- + until + do + echo "Iteration: $counter" + ((counter++)) + done + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/shellscript/changeConditionFive.yml b/data/fixtures/recorded/languages/shellscript/changeConditionFive.yml new file mode 100644 index 00000000000..36444036f62 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeConditionFive.yml @@ -0,0 +1,35 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change condition five + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: '5'} + modifiers: + - type: containingScope + scopeType: {type: condition} + usePrePhraseSnapshot: true +initialState: + documentContents: |2 + # C-style for loop + for ((i = 1; i <= 5; i++)); do + echo "C-style loop iteration: $i" + done + selections: + - anchor: {line: 1, character: 19} + active: {line: 1, character: 19} + marks: + default.5: + start: {line: 1, character: 20} + end: {line: 1, character: 21} +finalState: + documentContents: |2 + # C-style for loop + for ((i = 1; ; i++)); do + echo "C-style loop iteration: $i" + done + selections: + - anchor: {line: 1, character: 15} + active: {line: 1, character: 15} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryArg.yml b/data/fixtures/recorded/languages/shellscript/changeEveryArg.yml new file mode 100644 index 00000000000..edefcf2efb8 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryArg.yml @@ -0,0 +1,27 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every arg + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: everyScope + scopeType: {type: argumentOrParameter} + usePrePhraseSnapshot: true +initialState: + documentContents: echo a b c + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: "echo " + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml new file mode 100644 index 00000000000..1123e85397e --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml @@ -0,0 +1,32 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every arg inside fine + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + modifiers: + - type: everyScope + scopeType: {type: argumentOrParameter} + - {type: interiorOnly} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Foo ${BAR} as ${BAZ}" + selections: + - anchor: {line: 0, character: 19} + active: {line: 0, character: 19} + marks: + default.f: + start: {line: 0, character: 6} + end: {line: 0, character: 9} +finalState: + documentContents: | + echo "Foo as " + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml new file mode 100644 index 00000000000..a81c48d13af --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml @@ -0,0 +1,32 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every arg inside fine + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + modifiers: + - type: everyScope + scopeType: {type: argumentOrParameter} + - {type: interiorOnly} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Foo $BAR as $BAZ" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 6} + end: {line: 0, character: 9} +finalState: + documentContents: | + echo "Foo as " + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml new file mode 100644 index 00000000000..c29a2eb9f50 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml @@ -0,0 +1,32 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every arg inside trap + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: t} + modifiers: + - type: everyScope + scopeType: {type: argumentOrParameter} + - {type: interiorOnly} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Test ${foo} ${bar}" + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.t: + start: {line: 0, character: 6} + end: {line: 0, character: 10} +finalState: + documentContents: | + echo "Test " + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml new file mode 100644 index 00000000000..d9945e986a2 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml @@ -0,0 +1,32 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every arg inside trap + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: t} + modifiers: + - type: everyScope + scopeType: {type: argumentOrParameter} + - {type: interiorOnly} + usePrePhraseSnapshot: true +initialState: + documentContents: | + echo "Test $foo $bar" + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default.t: + start: {line: 0, character: 6} + end: {line: 0, character: 10} +finalState: + documentContents: | + echo "Test " + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryBranch.yml b/data/fixtures/recorded/languages/shellscript/changeEveryBranch.yml new file mode 100644 index 00000000000..389567cceab --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryBranch.yml @@ -0,0 +1,35 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: everyScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: | + if [ $value -le 0 ]; then + elif [ $value -le 0 ]; then + else + fi + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + marks: {} +finalState: + documentContents: | + + + + fi + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} + - anchor: {line: 2, character: 0} + active: {line: 2, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeEveryItem.yml b/data/fixtures/recorded/languages/shellscript/changeEveryItem.yml new file mode 100644 index 00000000000..f6d40ec02f1 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeEveryItem.yml @@ -0,0 +1,29 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change every item + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: everyScope + scopeType: {type: collectionItem} + usePrePhraseSnapshot: true +initialState: + documentContents: | + array=("apple" "banana" "cherry") + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: | + array=( ) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} diff --git a/data/fixtures/recorded/languages/shellscript/changeFunk.yml b/data/fixtures/recorded/languages/shellscript/changeFunk.yml new file mode 100644 index 00000000000..3a9da4ccb7d --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeFunk.yml @@ -0,0 +1,26 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change funk + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: namedFunction} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + function foo() { + echo "foo" + } + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeFunkName.yml b/data/fixtures/recorded/languages/shellscript/changeFunkName.yml new file mode 100644 index 00000000000..9adeb344343 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeFunkName.yml @@ -0,0 +1,29 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change funk name + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: functionName} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + function foo() { + echo "foo" + } + selections: + - anchor: {line: 1, character: 5} + active: {line: 1, character: 5} + marks: {} +finalState: + documentContents: |- + function () { + echo "foo" + } + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} diff --git a/data/fixtures/recorded/languages/shellscript/changeIfState.yml b/data/fixtures/recorded/languages/shellscript/changeIfState.yml new file mode 100644 index 00000000000..a328ac933f2 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeIfState.yml @@ -0,0 +1,28 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change if state + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: ifStatement} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 3, character: 8} + active: {line: 3, character: 8} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeInside.yml b/data/fixtures/recorded/languages/shellscript/changeInside.yml new file mode 100644 index 00000000000..c3353063d07 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInside.yml @@ -0,0 +1,22 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + usePrePhraseSnapshot: true +initialState: + documentContents: var="fo(o)" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: var="fo()" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} diff --git a/data/fixtures/recorded/languages/shellscript/changeInside2.yml b/data/fixtures/recorded/languages/shellscript/changeInside2.yml new file mode 100644 index 00000000000..88b884dedf5 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInside2.yml @@ -0,0 +1,22 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + usePrePhraseSnapshot: true +initialState: + documentContents: "# fo(o)" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "# fo()" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch.yml new file mode 100644 index 00000000000..562e179da29 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch.yml @@ -0,0 +1,34 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 3, character: 10} + active: {line: 3, character: 10} + marks: {} +finalState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + + fi + selections: + - anchor: {line: 3, character: 4} + active: {line: 3, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml new file mode 100644 index 00000000000..5b10df8e3b8 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml @@ -0,0 +1,38 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + elif [ "$number" -gt 42 ]; then + echo "The number is greater than 42" + else + echo "The number is less than than 42" + fi + selections: + - anchor: {line: 3, character: 16} + active: {line: 3, character: 16} + marks: {} +finalState: + documentContents: |- + if [ "$number" -eq 42 ]; then + echo "The number is 42" + elif [ "$number" -gt 42 ]; then + + else + echo "The number is less than than 42" + fi + selections: + - anchor: {line: 3, character: 4} + active: {line: 3, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml new file mode 100644 index 00000000000..3a1eaa76f8e --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml @@ -0,0 +1,33 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + fi + + selections: + - anchor: {line: 1, character: 15} + active: {line: 1, character: 15} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + + fi + + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml new file mode 100644 index 00000000000..ec6299e4342 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml @@ -0,0 +1,43 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + echo "foo1" + echo "foo1" + fi + + + + selections: + - anchor: {line: 4, character: 9} + active: {line: 4, character: 9} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + + fi + + + + selections: + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml new file mode 100644 index 00000000000..89bb109fb17 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml @@ -0,0 +1,42 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + echo "foo1" + fi + + + + selections: + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + + fi + + + + selections: + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml new file mode 100644 index 00000000000..aabefdf6cc1 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml @@ -0,0 +1,45 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + elif [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + echo "foo1" + echo "foo1" + fi + + selections: + - anchor: {line: 8, character: 3} + active: {line: 8, character: 3} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + elif [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + + fi + + selections: + - anchor: {line: 7, character: 4} + active: {line: 7, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml new file mode 100644 index 00000000000..eeec2cf3492 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml @@ -0,0 +1,44 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + elif [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + echo "foo1" + fi + + selections: + - anchor: {line: 7, character: 0} + active: {line: 7, character: 0} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + elif [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + + fi + + selections: + - anchor: {line: 7, character: 4} + active: {line: 7, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml b/data/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml new file mode 100644 index 00000000000..9ee82ccc9fd --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml @@ -0,0 +1,48 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: | + # Case statement + case "$number" in + 1) + echo "Number is 1" + ;; + 2) + echo "Number is 2" + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 6, character: 2} + active: {line: 6, character: 20} + marks: {} +finalState: + documentContents: | + # Case statement + case "$number" in + 1) + echo "Number is 1" + ;; + 2) + + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 6, character: 2} + active: {line: 6, character: 2} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml b/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml new file mode 100644 index 00000000000..ee01fe954c5 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml @@ -0,0 +1,43 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside every branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: everyScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + echo "foo1" + fi + + + + selections: + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + + else + + fi + + + + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + - anchor: {line: 3, character: 4} + active: {line: 3, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml b/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml new file mode 100644 index 00000000000..9a06c07ac89 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml @@ -0,0 +1,47 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside every branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: everyScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + if [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + elif [ $value -le 0 ]; then + echo "foo1" + echo "foo1" + else + echo "foo1" + echo "foo1" + fi + + selections: + - anchor: {line: 8, character: 3} + active: {line: 8, character: 3} + marks: {} +finalState: + documentContents: |+ + if [ $value -le 0 ]; then + + elif [ $value -le 0 ]; then + + else + + fi + + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + - anchor: {line: 3, character: 4} + active: {line: 3, character: 4} + - anchor: {line: 5, character: 4} + active: {line: 5, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml b/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml new file mode 100644 index 00000000000..8295f3a98bf --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml @@ -0,0 +1,52 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside every branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: everyScope + scopeType: {type: branch} + usePrePhraseSnapshot: true +initialState: + documentContents: | + # Case statement + case "$number" in + 1) + echo "Number is 1" + ;; + 2) + echo "Number is 2" + ;; + *) + echo "Number is not recognized" + ;; + esac + selections: + - anchor: {line: 3, character: 9} + active: {line: 3, character: 9} + marks: {} +finalState: + documentContents: | + # Case statement + case "$number" in + 1) + + ;; + 2) + + ;; + *) + + ;; + esac + selections: + - anchor: {line: 3, character: 2} + active: {line: 3, character: 2} + - anchor: {line: 6, character: 2} + active: {line: 6, character: 2} + - anchor: {line: 9, character: 2} + active: {line: 9, character: 2} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml b/data/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml new file mode 100644 index 00000000000..747b3b902be --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml @@ -0,0 +1,36 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside first branch + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: ordinalScope + scopeType: {type: branch} + start: 0 + length: 1 + usePrePhraseSnapshot: true +initialState: + documentContents: | + if [ "$number" -eq 42 ]; then + echo "The number is 42" + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 3, character: 2} + active: {line: 3, character: 2} + marks: {} +finalState: + documentContents: | + if [ "$number" -eq 42 ]; then + + else + echo "The number is not 42" + fi + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideFunk.yml b/data/fixtures/recorded/languages/shellscript/changeInsideFunk.yml new file mode 100644 index 00000000000..a5756df2672 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideFunk.yml @@ -0,0 +1,30 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside funk + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: namedFunction} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + function foo() { + echo "foo" + } + selections: + - anchor: {line: 1, character: 8} + active: {line: 1, character: 8} + marks: {} +finalState: + documentContents: |- + function foo() { + + } + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} diff --git a/data/fixtures/recorded/languages/shellscript/changeInsideList.yml b/data/fixtures/recorded/languages/shellscript/changeInsideList.yml new file mode 100644 index 00000000000..47c5241bc7c --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeInsideList.yml @@ -0,0 +1,24 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change inside list + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: list} + usePrePhraseSnapshot: true +initialState: + documentContents: array=("a" "b" "c") + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: {} +finalState: + documentContents: array=() + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} diff --git a/data/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml b/data/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml new file mode 100644 index 00000000000..2696735c942 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml @@ -0,0 +1,33 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change key crunch + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: k} + modifiers: + - type: containingScope + scopeType: {type: collectionKey} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + declare -A arr + arr["key1"]=val1 + arr+=([key2]=val2 ["key3"]=val3) + selections: + - anchor: {line: 2, character: 17} + active: {line: 2, character: 17} + marks: + default.k: + start: {line: 2, character: 7} + end: {line: 2, character: 11} +finalState: + documentContents: |- + declare -A arr + arr["key1"]=val1 + arr+=([]=val2 ["key3"]=val3) + selections: + - anchor: {line: 2, character: 7} + active: {line: 2, character: 7} diff --git a/data/fixtures/recorded/languages/shellscript/changeList.yml b/data/fixtures/recorded/languages/shellscript/changeList.yml new file mode 100644 index 00000000000..62881938cce --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeList.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change list + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: list} + usePrePhraseSnapshot: true +initialState: + documentContents: array=("a" "b" "c") + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: {} +finalState: + documentContents: array= + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/shellscript/changeName.yml b/data/fixtures/recorded/languages/shellscript/changeName.yml new file mode 100644 index 00000000000..c4c036b27d0 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeName.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change name + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: name} + usePrePhraseSnapshot: true +initialState: + documentContents: foo="bar" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: "=\"bar\"" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeName2.yml b/data/fixtures/recorded/languages/shellscript/changeName2.yml new file mode 100644 index 00000000000..61cb56765ad --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeName2.yml @@ -0,0 +1,27 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change name + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: name} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + local local_var="Local Variable" + + selections: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} + marks: {} +finalState: + documentContents: |+ + local ="Local Variable" + + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/shellscript/changeName3.yml b/data/fixtures/recorded/languages/shellscript/changeName3.yml new file mode 100644 index 00000000000..fdafe523adf --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeName3.yml @@ -0,0 +1,29 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change name + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: name} + usePrePhraseSnapshot: true +initialState: + documentContents: |- + for ((i = 1; i <= 5; i++)); do + echo "C-style loop iteration: $i" + done + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: |- + for (( = 1; i <= 5; i++)); do + echo "C-style loop iteration: $i" + done + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/shellscript/changeRegexZero.yml b/data/fixtures/recorded/languages/shellscript/changeRegexZero.yml new file mode 100644 index 00000000000..ddf64e8a347 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeRegexZero.yml @@ -0,0 +1,41 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change regex zero + action: + name: clearAndSetSelection + target: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: '0'} + modifiers: + - type: containingScope + scopeType: {type: regularExpression} + usePrePhraseSnapshot: true +initialState: + documentContents: |+ + + string="The date is 2023-01-01." + if [[ $string =~ ([0-9]{4}-[0-9]{2}-[0-9]{2}) ]]; then + matched_date="${BASH_REMATCH[1]}" + echo "Matched date: $matched_date" + fi + + selections: + - anchor: {line: 2, character: 5} + active: {line: 2, character: 5} + marks: + default.0: + start: {line: 2, character: 19} + end: {line: 2, character: 22} +finalState: + documentContents: |+ + + string="The date is 2023-01-01." + if [[ $string =~ ]]; then + matched_date="${BASH_REMATCH[1]}" + echo "Matched date: $matched_date" + fi + + selections: + - anchor: {line: 2, character: 17} + active: {line: 2, character: 17} diff --git a/data/fixtures/recorded/languages/shellscript/changeState.yml b/data/fixtures/recorded/languages/shellscript/changeState.yml new file mode 100644 index 00000000000..11e006bc7a5 --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeState.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change state + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: statement} + usePrePhraseSnapshot: true +initialState: + documentContents: var="foo" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/recorded/languages/shellscript/changeState2.yml b/data/fixtures/recorded/languages/shellscript/changeState2.yml new file mode 100644 index 00000000000..f1201ad27fa --- /dev/null +++ b/data/fixtures/recorded/languages/shellscript/changeState2.yml @@ -0,0 +1,23 @@ +languageId: shellscript +command: + version: 6 + spokenForm: change state + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: statement} + usePrePhraseSnapshot: true +initialState: + documentContents: cat ----------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/shellscript/list.scope b/data/fixtures/scopes/shellscript/list.scope new file mode 100644 index 00000000000..cd12626c82e --- /dev/null +++ b/data/fixtures/scopes/shellscript/list.scope @@ -0,0 +1,10 @@ +declare -a arr=("apple" "banana" "cherry") +--- + +[Content] = +[Removal] = +[Domain] = 0:15-0:42 +0| declare -a arr=("apple" "banana" "cherry") + >---------------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/shellscript/name.assignment.scope b/data/fixtures/scopes/shellscript/name.assignment.scope new file mode 100644 index 00000000000..8d80e210119 --- /dev/null +++ b/data/fixtures/scopes/shellscript/name.assignment.scope @@ -0,0 +1,20 @@ +local local_var="hello" +--- + +[Content] = 0:6-0:15 +0| local local_var="hello" + >---------< + +[Removal] = 0:0-0:16 +0| local local_var="hello" + >----------------< + +[Leading delimiter] = 0:5-0:6 +0| local local_var="hello" + >-< + +[Domain] = 0:0-0:23 +0| local local_var="hello" + >-----------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/shellscript/name.assignment2.scope b/data/fixtures/scopes/shellscript/name.assignment2.scope new file mode 100644 index 00000000000..8ebf2cfa109 --- /dev/null +++ b/data/fixtures/scopes/shellscript/name.assignment2.scope @@ -0,0 +1,20 @@ +declare local_var="hello" +--- + +[Content] = 0:8-0:17 +0| declare local_var="hello" + >---------< + +[Removal] = 0:0-0:18 +0| declare local_var="hello" + >------------------< + +[Leading delimiter] = 0:7-0:8 +0| declare local_var="hello" + >-< + +[Domain] = 0:0-0:25 +0| declare local_var="hello" + >-------------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/shellscript/name.assignment3.scope b/data/fixtures/scopes/shellscript/name.assignment3.scope new file mode 100644 index 00000000000..3260c937a00 --- /dev/null +++ b/data/fixtures/scopes/shellscript/name.assignment3.scope @@ -0,0 +1,20 @@ +local local_var +--- + +[Content] = 0:6-0:15 +0| local local_var + >---------< + +[Removal] = 0:5-0:15 +0| local local_var + >----------< + +[Leading delimiter] = 0:5-0:6 +0| local local_var + >-< + +[Domain] = 0:0-0:15 +0| local local_var + >---------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/shellscript/value.assignment.scope b/data/fixtures/scopes/shellscript/value.assignment.scope new file mode 100644 index 00000000000..18456d54cd4 --- /dev/null +++ b/data/fixtures/scopes/shellscript/value.assignment.scope @@ -0,0 +1,20 @@ +local name="Hello world" +--- + +[Content] = 0:11-0:24 +0| local name="Hello world" + >-------------< + +[Removal] = 0:10-0:24 +0| local name="Hello world" + >--------------< + +[Leading delimiter] = 0:10-0:11 +0| local name="Hello world" + >-< + +[Domain] = 0:0-0:24 +0| local name="Hello world" + >------------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/subtoken.fixture.ts b/data/fixtures/subtoken.fixture.ts new file mode 100644 index 00000000000..7916fa3baf8 --- /dev/null +++ b/data/fixtures/subtoken.fixture.ts @@ -0,0 +1,87 @@ +interface Fixture { + input: string; + expectedOutput: string[]; +} + +export const subtokenFixture: Fixture[] = [ + { + input: "QuickBrownFox", + expectedOutput: ["Quick", "Brown", "Fox"], + }, + { + input: "quickBrownFox", + expectedOutput: ["quick", "Brown", "Fox"], + }, + { + input: "quick_brown_fox", + expectedOutput: ["quick", "brown", "fox"], + }, + { + input: "QUICK_BROWN_FOX", + expectedOutput: ["QUICK", "BROWN", "FOX"], + }, + { + input: "quick-brown-fox", + expectedOutput: ["quick", "brown", "fox"], + }, + { + input: "QUICK-BROWN-FOX", + expectedOutput: ["QUICK", "BROWN", "FOX"], + }, + { + input: "quick.brown.fox", + expectedOutput: ["quick", "brown", "fox"], + }, + { + input: "QUICK.BROWN.FOX", + expectedOutput: ["QUICK", "BROWN", "FOX"], + }, + { + input: "../quick/brown/.fox", + expectedOutput: ["quick", "brown", "fox"], + }, + { + input: "../QUICK/BROWN/.FOX", + expectedOutput: ["QUICK", "BROWN", "FOX"], + }, + { + input: "quick::brown::fox", + expectedOutput: ["quick", "brown", "fox"], + }, + { + input: "QUICK::BROWN::FOX", + expectedOutput: ["QUICK", "BROWN", "FOX"], + }, + { + input: "APIClientFactory", + expectedOutput: ["API", "Client", "Factory"], + }, + { + input: "MockAPIClientFactory", + expectedOutput: ["Mock", "API", "Client", "Factory"], + }, + { + input: "mockAPIClientFactory", + expectedOutput: ["mock", "API", "Client", "Factory"], + }, + { + input: "mockAPIClient123FactoryV1", + expectedOutput: ["mock", "API", "Client", "123", "Factory", "V", "1"], + }, + { + input: "mock_api_client_123_factory_v1", + expectedOutput: ["mock", "api", "client", "123", "factory", "v1"], + }, + { + input: "v1", + expectedOutput: ["v", "1"], + }, + { + input: "aaBbÄä", + expectedOutput: ["aa", "Bb", "Ää"], + }, + { + input: "_quickBrownFox_", + expectedOutput: ["quick", "Brown", "Fox"], + }, +]; diff --git a/data/playground/shellscript/shellscript.sh b/data/playground/shellscript/shellscript.sh new file mode 100755 index 00000000000..85cda440fbd --- /dev/null +++ b/data/playground/shellscript/shellscript.sh @@ -0,0 +1,172 @@ +#!/bin/bash + + +# Variable declaration +var="Hello, World" +array=("apple" "banana" "cherry") + +# Output variables +echo "String variable: $var" +echo "Number variable: $number" +echo "Array variable: ${array[*]}" +echo A B C +# If statement +if [ "$number" -eq 42 ]; then + echo "The number is 42" +else + echo "The number is not 42" +fi + +# For loop +for item in "${array[@]}"; do + echo "Fruit: $item" +done + +# While loop +count=0 +while [ $count -lt 3 ]; do + echo "Count: $count" + ((count++)) +done + +# Function declaration +my_function() { + local local_var="Local Variable" + echo "Function argument: $1" + echo "$local_var from function" +} + +sub_function() (foo) +sub_function() ((foo++)) + +my_function "Function Argument" + +# Case statement +case "$number" in +1) + echo "Number is 1" + ;; +2) + echo "Number is 2" + ;; +42) + echo "Number is the answer to everything" + ;; +*) + echo "Number is not recognized" + ;; +esac + +# Advanced constructs +# Command substitution +current_date=$(date) + +# Conditional execution +ls non_existent_file || echo "File not found" + +# Here document +cat < "{1..5} + +# Extended globbing +shopt -s extglob +files="file1.txt file2.txt file3.log" +echo "Extended Globbing: ${files%%.*(txt|log)}" + +# Conditional execution and redirection +false && echo "This won't execute" +true || echo "This will execute" + +# Input redirection +cat = scala: scalaScopeSupport, scm: scmScopeSupport, scss: scssScopeSupport, + shellscript: shellscriptScopeSupport, talon: talonScopeSupport, typescript: typescriptScopeSupport, typescriptreact: typescriptreactScopeSupport, diff --git a/packages/common/src/scopeSupportFacets/shellscript.ts b/packages/common/src/scopeSupportFacets/shellscript.ts new file mode 100644 index 00000000000..59cd692ec9c --- /dev/null +++ b/packages/common/src/scopeSupportFacets/shellscript.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import { + LanguageScopeSupportFacetMap, + ScopeSupportFacetLevel, +} from "./scopeSupportFacets.types"; + +const { supported } = ScopeSupportFacetLevel; + +export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { + list: supported, + command: supported, + "name.assignment": supported, + "value.assignment": supported, +}; diff --git a/queries/shellscript.scm b/queries/shellscript.scm new file mode 100644 index 00000000000..0dcd771648d --- /dev/null +++ b/queries/shellscript.scm @@ -0,0 +1,311 @@ +;; +;; Statements +;; + +( + (program + (_) @statement + ) + (#not-type? @statement comment) +) +[ + (if_statement) + (while_statement) + (for_statement) + (function_definition) + (declaration_command) + (case_statement) + (subshell) + (list) + (redirected_statement) +] @statement + +;;FIXME: Make the #not-parent-type? thing a list of nodes +( + (_ + [ + (variable_assignment) + (command) + ] @statement + (#not-parent-type? @statement declaration_command c_style_for_statement list redirected_statement) + ) +) + +;; +;; Conditionals +;; + +(if_statement) @ifStatement @branch.iteration @condition.iteration + +;;!! if [ $value -le 0 ]; then +;;!! fi +(if_statement + "if" @condition.domain.start.startOf @branch.start.startOf + (_) @condition + "then" @condition.domain.end.endOf @branch.end.endOf + . + "fi" +) + +;;!! if [ $value -le 0 ]; then +;;!! else +(if_statement + "if" @condition.domain.start.startOf @branch.start.startOf + (_) @condition + "then" @condition.domain.end.endOf @branch.end.endOf + . + (else_clause) +) + +;;!! if [ $value -le 0 ]; then +;;!! elif +(if_statement + "if" @condition.domain.start.startOf @branch.start.startOf + (_) @condition + "then" @condition.domain.end.endOf @branch.end.endOf + . + (elif_clause) +) + +;;!! if [ $value -le 0 ]; then +;;!! echo foo +;;!! fi +( + (if_statement + "if" @condition.domain.start.startOf @branch.start.startOf + (_) @condition + "then" @branch.interior.start.endOf + (_) @dummy + . + "fi" @condition.domain.end.startOf @branch.end.startOf @branch.interior.end.startOf + ) + (#not-type? @dummy else_clause elif_clause) +) + +;;!! if [ $value -le 0 ]; then +;;!! echo foo +;;!! elif [ $value -le 0 ]; then +;;!! fi +( + (if_statement + "if" @condition.domain.start.startOf @branch.start.startOf + (_) @condition + "then" @branch.interior.start.endOf + (_) + (elif_clause) @condition.domain.end.startOf @branch.end.startOf @branch.interior.end.startOf + ) +) + +;;!! if [ $value -le 0 ]; then +;;!! echo foo +;;!! else [ $value -le 0 ]; then +;;!! fi +( + (if_statement + "if" @condition.domain.start.startOf @branch.start.startOf + (_) @condition + "then" @branch.interior.start.endOf + (_) @dummy + . + (else_clause) @condition.domain.end.startOf @branch.end.startOf @branch.interior.end.startOf + ) + (#not-type? @dummy elif_clause) +) + +;;!! elif [ $value -le 0 ]; then +;;!! else +(elif_clause + (_) @condition + "then" + . +) @branch @_.domain + +;;!! elif [ $value -le 0 ]; then +;;!! echo "foo1" +;;!! echo "foo1" +(elif_clause + (_) @condition + "then" @branch.interior.start.endOf + (_) +) @branch @_.domain @branch.interior.end.endOf + +;;!! else +;;!! fi +(else_clause + "else" + . +) @branch + +;;!! else +;;!! echo "foo1" +;;!! echo "foo1" +;;!! fi +(else_clause + "else" @branch.interior.start.endOf + (_) +) @branch @branch.interior.end.endOf + +(_ + condition: (_) @condition +) + +(case_statement) @branch.iteration @condition.iteration +(case_item + value: (_) @condition + . + ")" @branch.interior.start.endOf + (_) @branch.interior.end.endOf + . + ";;" +) @branch @_.domain + +;; Lists and maps +;; + +;;!! array=("a" "b" "c") +;;! ^^^^^^^^^^^^^ +;;! ------------- +(array + "(" @_.interior.start.endOf + (_)? @collectionItem + ")" @_.interior.end.startOf +) @list @collectionItem.iteration + +;;!! FIXME: I will file an issue in tree-sitter-bash as I think the grammar is +;;!! bad. But the below does work for now +;;!! arr+=(["key2"]=val2 ["key3"]=val3) +(array + ( + (concatenation + ;; This matches the [ which is (word) for some reason + (_) @collectionKey.leading.start + (_) @collectionKey + ;; This matches the ] which is also (word) for some reason + (_) @collectionKey.trailing.end + (_) @value + ) @collectionItem + (#shrink-to-match! @value "\=(?.*)") + ) +) + +;; +;; Strings +;; + +;;!! # foo +;;! ^^^^^ +(comment) @comment @textFragment + +;;!! var="foo" +;;! ^^^^^ +(string) @string @textFragment + +;;!! var="foo ${bar}" +;;! ^^^^^^ +;;! xxxxxx +(string + ( + (expansion) @argumentOrParameter + ;; FIXME: This is due to a tree-sitter-bash bug (imo) where given: "Foo ${BAR} ${BAZ}" + ;; ${BAZ} incorrectly includes preceding space + (#shrink-to-match! @argumentOrParameter "\\s*(?.*)") + ) +) +(string + (simple_expansion) @argumentOrParameter + (#shrink-to-match! @argumentOrParameter "\\s*(?.*)") +) + +;; +;; Functions +;; + +;;!! echo "foo" +;;! ^^^^^ +(_ + argument: (_) @argumentOrParameter +) @_.iteration + +;; call: +;;!! echo "foo" +;;! ^^^^^^^^^^ +;; callee: +;;!! echo "foo" +;;! ^^^^ +;;! ---------- +(command + name: (_) @functionCallee +) @_.domain @functionCall @command + +;;!! function foo() { +;;! ^^^ +;;! ---------------- +;;!! echo "foo" +;;! ---------- +;;!! } +;;! - +(function_definition + name: (_) @functionName +) @_.domain + +;; FIXME: Need to support redirections +;; interior: +;;!! function foo() { +;;! ---------------- +;;!! echo "foo" +;;! ^^^^^^^^^^ +;;! ---------- +;;!! } +;;! - +(function_definition + body: (_ + (_)? @_.interior + ) +) @namedFunction @_.domain + +;; +;; Names, values, and types +;; + +;;!! for ((i = 1; i <= 5; i++)); do +;;! ^ +;;! xxxx +;;! ----- +( + (variable_assignment + name: (_) @name @value.leading.endOf + value: (_) @value @name.trailing.startOf + ) @dummy @_.domain + (#not-parent-type? @dummy declaration_command) +) + +;;!! local foo="bar" +;;! ^^^ +;;! xxxxxxxxxx +;;! --------------- +(declaration_command + (variable_assignment + name: (_) @name + value: (_) @_.removal.end.startOf + ) +) @_.domain @_.removal.start.startOf + +;;!! local foo="bar" +;;! ^^^ +;;! xxxxxxxxxx +;;! --------------- +(declaration_command + (variable_assignment + name: (_) @_.leading.endOf + value: (_) @value + ) +) @_.domain + +;;!! local foo +;;! ^^^ +;;! --------- +(declaration_command + (variable_name) @name +) @_.domain + +(regex) @regularExpression @textFragment From 42f1f4b81fe4758a979725d1cf8a09a4055fe381 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 01:11:28 +0000 Subject: [PATCH 02/26] [pre-commit.ci lite] apply automatic fixes --- packages/common/src/scopeSupportFacets/shellscript.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/common/src/scopeSupportFacets/shellscript.ts b/packages/common/src/scopeSupportFacets/shellscript.ts index 59cd692ec9c..d92261456a8 100644 --- a/packages/common/src/scopeSupportFacets/shellscript.ts +++ b/packages/common/src/scopeSupportFacets/shellscript.ts @@ -1,9 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { - LanguageScopeSupportFacetMap, - ScopeSupportFacetLevel, -} from "./scopeSupportFacets.types"; +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported } = ScopeSupportFacetLevel; From bfcfe5b19f276f6353c758144a053a2122eea8cd Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 11:11:01 +0200 Subject: [PATCH 03/26] Remove legacy scope recorded test fixtures --- .../languages/shellscript/changeArg.yml | 23 ----- .../languages/shellscript/changeArg2.yml | 23 ----- .../languages/shellscript/changeArg3.yml | 23 ----- .../languages/shellscript/changeArg4.yml | 23 ----- .../languages/shellscript/changeArg5.yml | 25 ------ .../languages/shellscript/changeArgBat.yml | 29 ------- .../languages/shellscript/changeArgRed.yml | 29 ------- .../languages/shellscript/changeBranch.yml | 31 ------- .../languages/shellscript/changeBranch2.yml | 35 -------- .../languages/shellscript/changeBranch3.yml | 31 ------- .../languages/shellscript/changeBranch4.yml | 31 ------- .../languages/shellscript/changeBranch5.yml | 31 ------- .../languages/shellscript/changeBranch6.yml | 31 ------- .../languages/shellscript/changeBranch7.yml | 45 ---------- .../languages/shellscript/changeCall.yml | 23 ----- .../languages/shellscript/changeCallee.yml | 23 ----- .../languages/shellscript/changeCommand.yml | 23 ----- .../languages/shellscript/changeComment.yml | 23 ----- .../languages/shellscript/changeCondition.yml | 33 ------- .../shellscript/changeCondition2.yml | 39 --------- .../shellscript/changeCondition3.yml | 47 ---------- .../shellscript/changeConditionEach.yml | 37 -------- .../shellscript/changeConditionFive.yml | 35 -------- .../languages/shellscript/changeEveryArg.yml | 27 ------ .../shellscript/changeEveryArgInsideFine.yml | 32 ------- .../shellscript/changeEveryArgInsideFine2.yml | 32 ------- .../shellscript/changeEveryArgInsideTrap.yml | 32 ------- .../shellscript/changeEveryArgInsideTrap2.yml | 32 ------- .../shellscript/changeEveryBranch.yml | 35 -------- .../languages/shellscript/changeEveryItem.yml | 29 ------- .../languages/shellscript/changeFunk.yml | 26 ------ .../languages/shellscript/changeFunkName.yml | 29 ------- .../languages/shellscript/changeIfState.yml | 28 ------ .../languages/shellscript/changeInside.yml | 22 ----- .../languages/shellscript/changeInside2.yml | 22 ----- .../shellscript/changeInsideBranch.yml | 34 -------- .../shellscript/changeInsideBranch2.yml | 38 -------- .../shellscript/changeInsideBranch3.yml | 33 ------- .../shellscript/changeInsideBranch4.yml | 43 --------- .../shellscript/changeInsideBranch5.yml | 42 --------- .../shellscript/changeInsideBranch6.yml | 45 ---------- .../shellscript/changeInsideBranch7.yml | 44 ---------- .../shellscript/changeInsideBranch8.yml | 48 ---------- .../shellscript/changeInsideEveryBranch.yml | 43 --------- .../shellscript/changeInsideEveryBranch2.yml | 47 ---------- .../shellscript/changeInsideEveryBranch3.yml | 52 ----------- .../shellscript/changeInsideFirstBranch.yml | 36 -------- .../shellscript/changeInsideFunk.yml | 30 ------- .../shellscript/changeInsideList.yml | 24 ----- .../languages/shellscript/changeKeyCrunch.yml | 33 ------- .../languages/shellscript/changeList.yml | 23 ----- .../languages/shellscript/changeName.yml | 23 ----- .../languages/shellscript/changeName2.yml | 27 ------ .../languages/shellscript/changeName3.yml | 29 ------- .../languages/shellscript/changeRegexZero.yml | 41 --------- .../languages/shellscript/changeState.yml | 23 ----- .../languages/shellscript/changeState2.yml | 23 ----- .../languages/shellscript/changeState3.yml | 23 ----- .../languages/shellscript/changeString.yml | 23 ----- .../shellscript/changeThirdWordDash.yml | 31 ------- .../languages/shellscript/changeValue.yml | 23 ----- .../languages/shellscript/changeValueOne.yml | 35 -------- .../languages/shellscript/changeValueVest.yml | 33 ------- .../languages/shellscript/chuckArg.yml | 23 ----- .../languages/shellscript/chuckArg2.yml | 23 ----- .../languages/shellscript/chuckArgZip.yml | 29 ------- .../shellscript/chuckFirstWordBat.yml | 31 ------- .../shellscript/chuckInsideBranch.yml | 47 ---------- .../languages/shellscript/chuckItem.yml | 25 ------ .../languages/shellscript/chuckItem2.yml | 25 ------ .../languages/shellscript/chuckName.yml | 23 ----- .../shellscript/chuckNameGreenSit.yml | 35 -------- .../shellscript/chuckSecondWordCap.yml | 31 ------- .../languages/shellscript/chuckValue.yml | 23 ----- .../languages/shellscript/chuckValue2.yml | 25 ------ .../languages/shellscript/chuckValueOne.yml | 35 -------- resources/fixtures/subtoken.fixture.ts | 87 ------------------- 77 files changed, 2450 deletions(-) delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArg.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArg2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArg3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArg4.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArg5.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArgBat.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeArgRed.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch4.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch5.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch6.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeBranch7.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeCall.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeCallee.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeCommand.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeComment.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeCondition.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeCondition2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeCondition3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeConditionEach.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeConditionFive.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryArg.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryBranch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeEveryItem.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeFunk.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeFunkName.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeIfState.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInside.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInside2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideFunk.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeInsideList.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeList.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeName.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeName2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeName3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeRegexZero.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeState.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeState2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeState3.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeString.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeThirdWordDash.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeValue.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeValueOne.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/changeValueVest.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckArg.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckArg2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckArgZip.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckFirstWordBat.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckInsideBranch.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckItem.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckItem2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckName.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckNameGreenSit.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckSecondWordCap.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckValue.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckValue2.yml delete mode 100644 resources/fixtures/recorded/languages/shellscript/chuckValueOne.yml delete mode 100644 resources/fixtures/subtoken.fixture.ts diff --git a/resources/fixtures/recorded/languages/shellscript/changeArg.yml b/resources/fixtures/recorded/languages/shellscript/changeArg.yml deleted file mode 100644 index dd3d7864687..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArg.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: var="foo ${bar}" - selections: - - anchor: {line: 0, character: 13} - active: {line: 0, character: 13} - marks: {} -finalState: - documentContents: var="foo " - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/languages/shellscript/changeArg2.yml b/resources/fixtures/recorded/languages/shellscript/changeArg2.yml deleted file mode 100644 index 784d5d5a76d..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArg2.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: var="foo $bar" - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - marks: {} -finalState: - documentContents: var="foo " - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/languages/shellscript/changeArg3.yml b/resources/fixtures/recorded/languages/shellscript/changeArg3.yml deleted file mode 100644 index c57d0c9088f..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArg3.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: echo "foo" - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} - marks: {} -finalState: - documentContents: "echo " - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/languages/shellscript/changeArg4.yml b/resources/fixtures/recorded/languages/shellscript/changeArg4.yml deleted file mode 100644 index adcae9517bc..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArg4.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: echo "foo" "bar" - selections: - - anchor: {line: 0, character: 15} - active: {line: 0, character: 15} - marks: {} -finalState: - documentContents: "echo \"foo\" " - selections: - - anchor: {line: 0, character: 11} - active: {line: 0, character: 11} diff --git a/resources/fixtures/recorded/languages/shellscript/changeArg5.yml b/resources/fixtures/recorded/languages/shellscript/changeArg5.yml deleted file mode 100644 index 1fcae07e876..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArg5.yml +++ /dev/null @@ -1,25 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Foo ${BAR}" - selections: - - anchor: {line: 0, character: 12} - active: {line: 0, character: 12} - marks: {} -finalState: - documentContents: | - echo "Foo " - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} diff --git a/resources/fixtures/recorded/languages/shellscript/changeArgBat.yml b/resources/fixtures/recorded/languages/shellscript/changeArgBat.yml deleted file mode 100644 index 13834d9ec30..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArgBat.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg bat - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: b} - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Foo ${BAR} ${BAZ} bar" - selections: - - anchor: {line: 0, character: 28} - active: {line: 0, character: 28} - marks: - default.b: - start: {line: 0, character: 12} - end: {line: 0, character: 15} -finalState: - documentContents: | - echo "Foo ${BAZ} bar" - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} diff --git a/resources/fixtures/recorded/languages/shellscript/changeArgRed.yml b/resources/fixtures/recorded/languages/shellscript/changeArgRed.yml deleted file mode 100644 index a83ac5f9a65..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeArgRed.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change arg red - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: r} - modifiers: - - type: containingScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Foo $BAR as $BAZ" - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} - marks: - default.r: - start: {line: 0, character: 11} - end: {line: 0, character: 14} -finalState: - documentContents: | - echo "Foo as $BAZ" - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch.yml deleted file mode 100644 index 3152de1f4dc..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch.yml +++ /dev/null @@ -1,31 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 3, character: 10} - active: {line: 3, character: 10} - marks: {} -finalState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - fi - selections: - - anchor: {line: 2, character: 0} - active: {line: 2, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch2.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch2.yml deleted file mode 100644 index 9b7b1c57e37..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch2.yml +++ /dev/null @@ -1,35 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - elif [ "$number" -gt 42 ]; then - echo "The number is greater than 42" - else - echo "The number is less than than 42" - fi - selections: - - anchor: {line: 3, character: 10} - active: {line: 3, character: 10} - marks: {} -finalState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - echo "The number is less than than 42" - fi - selections: - - anchor: {line: 2, character: 0} - active: {line: 2, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch3.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch3.yml deleted file mode 100644 index 1b13c1718e6..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch3.yml +++ /dev/null @@ -1,31 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - fi - - - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - marks: {} -finalState: - documentContents: |+ - - fi - - - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch4.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch4.yml deleted file mode 100644 index b422d8f65ac..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch4.yml +++ /dev/null @@ -1,31 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - else - fi - - selections: - - anchor: {line: 1, character: 2} - active: {line: 1, character: 2} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - - fi - - selections: - - anchor: {line: 1, character: 0} - active: {line: 1, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch5.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch5.yml deleted file mode 100644 index 80923898927..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch5.yml +++ /dev/null @@ -1,31 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - else - fi - - selections: - - anchor: {line: 0, character: 2} - active: {line: 0, character: 2} - marks: {} -finalState: - documentContents: |+ - - else - fi - - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch6.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch6.yml deleted file mode 100644 index c0703b6ef3e..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch6.yml +++ /dev/null @@ -1,31 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: | - if [ $value -le 0 ]; then - elif [ $value -le 0 ]; then - else - fi - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} - marks: {} -finalState: - documentContents: | - if [ $value -le 0 ]; then - - else - fi - selections: - - anchor: {line: 1, character: 0} - active: {line: 1, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeBranch7.yml b/resources/fixtures/recorded/languages/shellscript/changeBranch7.yml deleted file mode 100644 index 8225b8c671f..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeBranch7.yml +++ /dev/null @@ -1,45 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: | - # Case statement - case "$number" in - 1) - echo "Number is 1" - ;; - 2) - echo "Number is 2" - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 4, character: 4} - active: {line: 4, character: 4} - marks: {} -finalState: - documentContents: | - # Case statement - case "$number" in - - 2) - echo "Number is 2" - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 2, character: 0} - active: {line: 2, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeCall.yml b/resources/fixtures/recorded/languages/shellscript/changeCall.yml deleted file mode 100644 index f6695695135..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeCall.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change call - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: functionCall} - usePrePhraseSnapshot: true -initialState: - documentContents: echo "foo" - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - marks: {} -finalState: - documentContents: "" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeCallee.yml b/resources/fixtures/recorded/languages/shellscript/changeCallee.yml deleted file mode 100644 index e2518f8f5c9..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeCallee.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change callee - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: functionCallee} - usePrePhraseSnapshot: true -initialState: - documentContents: echo "foo" - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - marks: {} -finalState: - documentContents: " \"foo\"" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeCommand.yml b/resources/fixtures/recorded/languages/shellscript/changeCommand.yml deleted file mode 100644 index b1fcd5b055c..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeCommand.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change command - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: command} - usePrePhraseSnapshot: true -initialState: - documentContents: ls non_existent_file || echo "File not found" - selections: - - anchor: {line: 0, character: 26} - active: {line: 0, character: 26} - marks: {} -finalState: - documentContents: "ls non_existent_file || " - selections: - - anchor: {line: 0, character: 24} - active: {line: 0, character: 24} diff --git a/resources/fixtures/recorded/languages/shellscript/changeComment.yml b/resources/fixtures/recorded/languages/shellscript/changeComment.yml deleted file mode 100644 index c95882fe57b..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeComment.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change comment - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: comment} - usePrePhraseSnapshot: true -initialState: - documentContents: "# foo" - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 5} - marks: {} -finalState: - documentContents: "" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeCondition.yml b/resources/fixtures/recorded/languages/shellscript/changeCondition.yml deleted file mode 100644 index cddbd5978e4..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeCondition.yml +++ /dev/null @@ -1,33 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change condition - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: condition} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 0, character: 8} - active: {line: 0, character: 8} - marks: {} -finalState: - documentContents: |- - if ; then - echo "The number is 42" - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 0, character: 3} - active: {line: 0, character: 3} diff --git a/resources/fixtures/recorded/languages/shellscript/changeCondition2.yml b/resources/fixtures/recorded/languages/shellscript/changeCondition2.yml deleted file mode 100644 index c86baf27d8b..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeCondition2.yml +++ /dev/null @@ -1,39 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change condition - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: condition} - usePrePhraseSnapshot: true -initialState: - documentContents: | - - if [["$number" -eq 42 ]]; then - echo "number match" - elif [[ $number -lt 20 ]]; then - echo "< 20" - else - echo "No match" - fi - selections: - - anchor: {line: 4, character: 6} - active: {line: 4, character: 6} - marks: {} -finalState: - documentContents: | - - if [["$number" -eq 42 ]]; then - echo "number match" - elif ; then - echo "< 20" - else - echo "No match" - fi - selections: - - anchor: {line: 3, character: 5} - active: {line: 3, character: 5} diff --git a/resources/fixtures/recorded/languages/shellscript/changeCondition3.yml b/resources/fixtures/recorded/languages/shellscript/changeCondition3.yml deleted file mode 100644 index 11880bdc830..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeCondition3.yml +++ /dev/null @@ -1,47 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change condition - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: condition} - usePrePhraseSnapshot: true -initialState: - documentContents: | - # Case statement - case "$number" in - 1) - echo "Number is 1" - ;; - 2) - echo "Number is 2" - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 3, character: 9} - active: {line: 3, character: 9} - marks: {} -finalState: - documentContents: | - # Case statement - case "$number" in - ) - echo "Number is 1" - ;; - 2) - echo "Number is 2" - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 2, character: 0} - active: {line: 2, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeConditionEach.yml b/resources/fixtures/recorded/languages/shellscript/changeConditionEach.yml deleted file mode 100644 index dfbdf5cb14b..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeConditionEach.yml +++ /dev/null @@ -1,37 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change condition each - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: e} - modifiers: - - type: containingScope - scopeType: {type: condition} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - until [ $counter -gt 5 ] - do - echo "Iteration: $counter" - ((counter++)) - done - selections: - - anchor: {line: 4, character: 4} - active: {line: 4, character: 4} - marks: - default.e: - start: {line: 0, character: 9} - end: {line: 0, character: 16} -finalState: - documentContents: |- - until - do - echo "Iteration: $counter" - ((counter++)) - done - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/resources/fixtures/recorded/languages/shellscript/changeConditionFive.yml b/resources/fixtures/recorded/languages/shellscript/changeConditionFive.yml deleted file mode 100644 index 36444036f62..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeConditionFive.yml +++ /dev/null @@ -1,35 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change condition five - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: '5'} - modifiers: - - type: containingScope - scopeType: {type: condition} - usePrePhraseSnapshot: true -initialState: - documentContents: |2 - # C-style for loop - for ((i = 1; i <= 5; i++)); do - echo "C-style loop iteration: $i" - done - selections: - - anchor: {line: 1, character: 19} - active: {line: 1, character: 19} - marks: - default.5: - start: {line: 1, character: 20} - end: {line: 1, character: 21} -finalState: - documentContents: |2 - # C-style for loop - for ((i = 1; ; i++)); do - echo "C-style loop iteration: $i" - done - selections: - - anchor: {line: 1, character: 15} - active: {line: 1, character: 15} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryArg.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryArg.yml deleted file mode 100644 index edefcf2efb8..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryArg.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every arg - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: everyScope - scopeType: {type: argumentOrParameter} - usePrePhraseSnapshot: true -initialState: - documentContents: echo a b c - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - marks: {} -finalState: - documentContents: "echo " - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 5} - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml deleted file mode 100644 index 1123e85397e..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine.yml +++ /dev/null @@ -1,32 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every arg inside fine - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: f} - modifiers: - - type: everyScope - scopeType: {type: argumentOrParameter} - - {type: interiorOnly} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Foo ${BAR} as ${BAZ}" - selections: - - anchor: {line: 0, character: 19} - active: {line: 0, character: 19} - marks: - default.f: - start: {line: 0, character: 6} - end: {line: 0, character: 9} -finalState: - documentContents: | - echo "Foo as " - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - - anchor: {line: 0, character: 14} - active: {line: 0, character: 14} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml deleted file mode 100644 index a81c48d13af..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideFine2.yml +++ /dev/null @@ -1,32 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every arg inside fine - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: f} - modifiers: - - type: everyScope - scopeType: {type: argumentOrParameter} - - {type: interiorOnly} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Foo $BAR as $BAZ" - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} - marks: - default.f: - start: {line: 0, character: 6} - end: {line: 0, character: 9} -finalState: - documentContents: | - echo "Foo as " - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - - anchor: {line: 0, character: 14} - active: {line: 0, character: 14} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml deleted file mode 100644 index c29a2eb9f50..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap.yml +++ /dev/null @@ -1,32 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every arg inside trap - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: t} - modifiers: - - type: everyScope - scopeType: {type: argumentOrParameter} - - {type: interiorOnly} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Test ${foo} ${bar}" - selections: - - anchor: {line: 0, character: 13} - active: {line: 0, character: 13} - marks: - default.t: - start: {line: 0, character: 6} - end: {line: 0, character: 10} -finalState: - documentContents: | - echo "Test " - selections: - - anchor: {line: 0, character: 11} - active: {line: 0, character: 11} - - anchor: {line: 0, character: 12} - active: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml deleted file mode 100644 index d9945e986a2..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryArgInsideTrap2.yml +++ /dev/null @@ -1,32 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every arg inside trap - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: t} - modifiers: - - type: everyScope - scopeType: {type: argumentOrParameter} - - {type: interiorOnly} - usePrePhraseSnapshot: true -initialState: - documentContents: | - echo "Test $foo $bar" - selections: - - anchor: {line: 0, character: 14} - active: {line: 0, character: 14} - marks: - default.t: - start: {line: 0, character: 6} - end: {line: 0, character: 10} -finalState: - documentContents: | - echo "Test " - selections: - - anchor: {line: 0, character: 11} - active: {line: 0, character: 11} - - anchor: {line: 0, character: 12} - active: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryBranch.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryBranch.yml deleted file mode 100644 index 389567cceab..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryBranch.yml +++ /dev/null @@ -1,35 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: everyScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: | - if [ $value -le 0 ]; then - elif [ $value -le 0 ]; then - else - fi - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} - marks: {} -finalState: - documentContents: | - - - - fi - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - - anchor: {line: 1, character: 0} - active: {line: 1, character: 0} - - anchor: {line: 2, character: 0} - active: {line: 2, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeEveryItem.yml b/resources/fixtures/recorded/languages/shellscript/changeEveryItem.yml deleted file mode 100644 index f6d40ec02f1..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeEveryItem.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change every item - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: everyScope - scopeType: {type: collectionItem} - usePrePhraseSnapshot: true -initialState: - documentContents: | - array=("apple" "banana" "cherry") - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} - marks: {} -finalState: - documentContents: | - array=( ) - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} - - anchor: {line: 0, character: 8} - active: {line: 0, character: 8} - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/languages/shellscript/changeFunk.yml b/resources/fixtures/recorded/languages/shellscript/changeFunk.yml deleted file mode 100644 index 3a9da4ccb7d..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeFunk.yml +++ /dev/null @@ -1,26 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change funk - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: namedFunction} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - function foo() { - echo "foo" - } - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} - marks: {} -finalState: - documentContents: "" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeFunkName.yml b/resources/fixtures/recorded/languages/shellscript/changeFunkName.yml deleted file mode 100644 index 9adeb344343..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeFunkName.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change funk name - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: functionName} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - function foo() { - echo "foo" - } - selections: - - anchor: {line: 1, character: 5} - active: {line: 1, character: 5} - marks: {} -finalState: - documentContents: |- - function () { - echo "foo" - } - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/languages/shellscript/changeIfState.yml b/resources/fixtures/recorded/languages/shellscript/changeIfState.yml deleted file mode 100644 index a328ac933f2..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeIfState.yml +++ /dev/null @@ -1,28 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change if state - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: ifStatement} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 3, character: 8} - active: {line: 3, character: 8} - marks: {} -finalState: - documentContents: "" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInside.yml b/resources/fixtures/recorded/languages/shellscript/changeInside.yml deleted file mode 100644 index c3353063d07..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInside.yml +++ /dev/null @@ -1,22 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - usePrePhraseSnapshot: true -initialState: - documentContents: var="fo(o)" - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} - marks: {} -finalState: - documentContents: var="fo()" - selections: - - anchor: {line: 0, character: 8} - active: {line: 0, character: 8} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInside2.yml b/resources/fixtures/recorded/languages/shellscript/changeInside2.yml deleted file mode 100644 index 88b884dedf5..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInside2.yml +++ /dev/null @@ -1,22 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - usePrePhraseSnapshot: true -initialState: - documentContents: "# fo(o)" - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 5} - marks: {} -finalState: - documentContents: "# fo()" - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch.yml deleted file mode 100644 index 562e179da29..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch.yml +++ /dev/null @@ -1,34 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 3, character: 10} - active: {line: 3, character: 10} - marks: {} -finalState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - - fi - selections: - - anchor: {line: 3, character: 4} - active: {line: 3, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml deleted file mode 100644 index 5b10df8e3b8..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch2.yml +++ /dev/null @@ -1,38 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - elif [ "$number" -gt 42 ]; then - echo "The number is greater than 42" - else - echo "The number is less than than 42" - fi - selections: - - anchor: {line: 3, character: 16} - active: {line: 3, character: 16} - marks: {} -finalState: - documentContents: |- - if [ "$number" -eq 42 ]; then - echo "The number is 42" - elif [ "$number" -gt 42 ]; then - - else - echo "The number is less than than 42" - fi - selections: - - anchor: {line: 3, character: 4} - active: {line: 3, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml deleted file mode 100644 index 3a1eaa76f8e..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch3.yml +++ /dev/null @@ -1,33 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - fi - - selections: - - anchor: {line: 1, character: 15} - active: {line: 1, character: 15} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - - fi - - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml deleted file mode 100644 index ec6299e4342..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch4.yml +++ /dev/null @@ -1,43 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - echo "foo1" - echo "foo1" - fi - - - - selections: - - anchor: {line: 4, character: 9} - active: {line: 4, character: 9} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - - fi - - - - selections: - - anchor: {line: 4, character: 4} - active: {line: 4, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml deleted file mode 100644 index 89bb109fb17..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch5.yml +++ /dev/null @@ -1,42 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - echo "foo1" - fi - - - - selections: - - anchor: {line: 4, character: 4} - active: {line: 4, character: 4} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - - fi - - - - selections: - - anchor: {line: 4, character: 4} - active: {line: 4, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml deleted file mode 100644 index aabefdf6cc1..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch6.yml +++ /dev/null @@ -1,45 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - elif [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - echo "foo1" - echo "foo1" - fi - - selections: - - anchor: {line: 8, character: 3} - active: {line: 8, character: 3} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - elif [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - - fi - - selections: - - anchor: {line: 7, character: 4} - active: {line: 7, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml deleted file mode 100644 index eeec2cf3492..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch7.yml +++ /dev/null @@ -1,44 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - elif [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - echo "foo1" - fi - - selections: - - anchor: {line: 7, character: 0} - active: {line: 7, character: 0} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - elif [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - - fi - - selections: - - anchor: {line: 7, character: 4} - active: {line: 7, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml deleted file mode 100644 index 9ee82ccc9fd..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideBranch8.yml +++ /dev/null @@ -1,48 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: | - # Case statement - case "$number" in - 1) - echo "Number is 1" - ;; - 2) - echo "Number is 2" - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 6, character: 2} - active: {line: 6, character: 20} - marks: {} -finalState: - documentContents: | - # Case statement - case "$number" in - 1) - echo "Number is 1" - ;; - 2) - - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 6, character: 2} - active: {line: 6, character: 2} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml deleted file mode 100644 index ee01fe954c5..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch.yml +++ /dev/null @@ -1,43 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside every branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: everyScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - echo "foo1" - fi - - - - selections: - - anchor: {line: 4, character: 4} - active: {line: 4, character: 4} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - - else - - fi - - - - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} - - anchor: {line: 3, character: 4} - active: {line: 3, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml deleted file mode 100644 index 9a06c07ac89..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch2.yml +++ /dev/null @@ -1,47 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside every branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: everyScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - if [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - elif [ $value -le 0 ]; then - echo "foo1" - echo "foo1" - else - echo "foo1" - echo "foo1" - fi - - selections: - - anchor: {line: 8, character: 3} - active: {line: 8, character: 3} - marks: {} -finalState: - documentContents: |+ - if [ $value -le 0 ]; then - - elif [ $value -le 0 ]; then - - else - - fi - - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} - - anchor: {line: 3, character: 4} - active: {line: 3, character: 4} - - anchor: {line: 5, character: 4} - active: {line: 5, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml deleted file mode 100644 index 8295f3a98bf..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideEveryBranch3.yml +++ /dev/null @@ -1,52 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside every branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: everyScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: | - # Case statement - case "$number" in - 1) - echo "Number is 1" - ;; - 2) - echo "Number is 2" - ;; - *) - echo "Number is not recognized" - ;; - esac - selections: - - anchor: {line: 3, character: 9} - active: {line: 3, character: 9} - marks: {} -finalState: - documentContents: | - # Case statement - case "$number" in - 1) - - ;; - 2) - - ;; - *) - - ;; - esac - selections: - - anchor: {line: 3, character: 2} - active: {line: 3, character: 2} - - anchor: {line: 6, character: 2} - active: {line: 6, character: 2} - - anchor: {line: 9, character: 2} - active: {line: 9, character: 2} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml deleted file mode 100644 index 747b3b902be..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideFirstBranch.yml +++ /dev/null @@ -1,36 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside first branch - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: ordinalScope - scopeType: {type: branch} - start: 0 - length: 1 - usePrePhraseSnapshot: true -initialState: - documentContents: | - if [ "$number" -eq 42 ]; then - echo "The number is 42" - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 3, character: 2} - active: {line: 3, character: 2} - marks: {} -finalState: - documentContents: | - if [ "$number" -eq 42 ]; then - - else - echo "The number is not 42" - fi - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideFunk.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideFunk.yml deleted file mode 100644 index a5756df2672..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideFunk.yml +++ /dev/null @@ -1,30 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside funk - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: namedFunction} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - function foo() { - echo "foo" - } - selections: - - anchor: {line: 1, character: 8} - active: {line: 1, character: 8} - marks: {} -finalState: - documentContents: |- - function foo() { - - } - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} diff --git a/resources/fixtures/recorded/languages/shellscript/changeInsideList.yml b/resources/fixtures/recorded/languages/shellscript/changeInsideList.yml deleted file mode 100644 index 47c5241bc7c..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeInsideList.yml +++ /dev/null @@ -1,24 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change inside list - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: list} - usePrePhraseSnapshot: true -initialState: - documentContents: array=("a" "b" "c") - selections: - - anchor: {line: 0, character: 13} - active: {line: 0, character: 13} - marks: {} -finalState: - documentContents: array=() - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml b/resources/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml deleted file mode 100644 index 2696735c942..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeKeyCrunch.yml +++ /dev/null @@ -1,33 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change key crunch - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: k} - modifiers: - - type: containingScope - scopeType: {type: collectionKey} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - declare -A arr - arr["key1"]=val1 - arr+=([key2]=val2 ["key3"]=val3) - selections: - - anchor: {line: 2, character: 17} - active: {line: 2, character: 17} - marks: - default.k: - start: {line: 2, character: 7} - end: {line: 2, character: 11} -finalState: - documentContents: |- - declare -A arr - arr["key1"]=val1 - arr+=([]=val2 ["key3"]=val3) - selections: - - anchor: {line: 2, character: 7} - active: {line: 2, character: 7} diff --git a/resources/fixtures/recorded/languages/shellscript/changeList.yml b/resources/fixtures/recorded/languages/shellscript/changeList.yml deleted file mode 100644 index 62881938cce..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeList.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change list - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - usePrePhraseSnapshot: true -initialState: - documentContents: array=("a" "b" "c") - selections: - - anchor: {line: 0, character: 13} - active: {line: 0, character: 13} - marks: {} -finalState: - documentContents: array= - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/resources/fixtures/recorded/languages/shellscript/changeName.yml b/resources/fixtures/recorded/languages/shellscript/changeName.yml deleted file mode 100644 index c4c036b27d0..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeName.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change name - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: name} - usePrePhraseSnapshot: true -initialState: - documentContents: foo="bar" - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} - marks: {} -finalState: - documentContents: "=\"bar\"" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeName2.yml b/resources/fixtures/recorded/languages/shellscript/changeName2.yml deleted file mode 100644 index 61cb56765ad..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeName2.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change name - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: name} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - local local_var="Local Variable" - - selections: - - anchor: {line: 0, character: 18} - active: {line: 0, character: 18} - marks: {} -finalState: - documentContents: |+ - local ="Local Variable" - - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/resources/fixtures/recorded/languages/shellscript/changeName3.yml b/resources/fixtures/recorded/languages/shellscript/changeName3.yml deleted file mode 100644 index fdafe523adf..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeName3.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change name - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: name} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - for ((i = 1; i <= 5; i++)); do - echo "C-style loop iteration: $i" - done - selections: - - anchor: {line: 0, character: 8} - active: {line: 0, character: 8} - marks: {} -finalState: - documentContents: |- - for (( = 1; i <= 5; i++)); do - echo "C-style loop iteration: $i" - done - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/resources/fixtures/recorded/languages/shellscript/changeRegexZero.yml b/resources/fixtures/recorded/languages/shellscript/changeRegexZero.yml deleted file mode 100644 index ddf64e8a347..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeRegexZero.yml +++ /dev/null @@ -1,41 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change regex zero - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: '0'} - modifiers: - - type: containingScope - scopeType: {type: regularExpression} - usePrePhraseSnapshot: true -initialState: - documentContents: |+ - - string="The date is 2023-01-01." - if [[ $string =~ ([0-9]{4}-[0-9]{2}-[0-9]{2}) ]]; then - matched_date="${BASH_REMATCH[1]}" - echo "Matched date: $matched_date" - fi - - selections: - - anchor: {line: 2, character: 5} - active: {line: 2, character: 5} - marks: - default.0: - start: {line: 2, character: 19} - end: {line: 2, character: 22} -finalState: - documentContents: |+ - - string="The date is 2023-01-01." - if [[ $string =~ ]]; then - matched_date="${BASH_REMATCH[1]}" - echo "Matched date: $matched_date" - fi - - selections: - - anchor: {line: 2, character: 17} - active: {line: 2, character: 17} diff --git a/resources/fixtures/recorded/languages/shellscript/changeState.yml b/resources/fixtures/recorded/languages/shellscript/changeState.yml deleted file mode 100644 index 11e006bc7a5..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeState.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change state - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: statement} - usePrePhraseSnapshot: true -initialState: - documentContents: var="foo" - selections: - - anchor: {line: 0, character: 2} - active: {line: 0, character: 2} - marks: {} -finalState: - documentContents: "" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} diff --git a/resources/fixtures/recorded/languages/shellscript/changeState2.yml b/resources/fixtures/recorded/languages/shellscript/changeState2.yml deleted file mode 100644 index f1201ad27fa..00000000000 --- a/resources/fixtures/recorded/languages/shellscript/changeState2.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: shellscript -command: - version: 6 - spokenForm: change state - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: statement} - usePrePhraseSnapshot: true -initialState: - documentContents: cat Date: Wed, 9 Sep 2026 11:26:05 +0200 Subject: [PATCH 04/26] Added scope support definitions --- .../src/scopeSupportFacets/shellscript.ts | 366 +++++++++++++++++- 1 file changed, 364 insertions(+), 2 deletions(-) diff --git a/packages/lib-common/src/scopeSupportFacets/shellscript.ts b/packages/lib-common/src/scopeSupportFacets/shellscript.ts index d92261456a8..605282c2da4 100644 --- a/packages/lib-common/src/scopeSupportFacets/shellscript.ts +++ b/packages/lib-common/src/scopeSupportFacets/shellscript.ts @@ -3,11 +3,373 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported } = ScopeSupportFacetLevel; +const { supported, notApplicable } = ScopeSupportFacetLevel; export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { list: supported, - command: supported, + + "argument.actual.singleLine": supported, + "argument.actual.multiLine": supported, + "argument.actual.iteration": supported, + + "branch.if": supported, + "branch.if.elif.else": supported, + "branch.if.else": supported, + "branch.if.iteration": supported, + "branch.switchCase": supported, + "branch.switchCase.iteration": supported, + "branch.ternary": supported, + "branch.ternary.iteration": supported, + + "comment.line": supported, + + "condition.if": supported, + "condition.while": supported, + "condition.for": supported, + "condition.switchCase": supported, + "condition.switchCase.iteration": supported, + "condition.ternary": supported, + + functionCall: supported, + + functionCallee: supported, + + namedFunction: supported, + "namedFunction.iteration.document": supported, + + ifStatement: supported, + + "statement.function": supported, + "statement.functionCall": supported, + "statement.if": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, + "statement.constant": supported, + "statement.assignment": supported, + "statement.assignment.compound": supported, + "statement.return": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.command": supported, + "statement.import": supported, + "statement.misc": supported, + "statement.update": supported, + "statement.iteration.document": supported, + "statement.iteration.block": supported, + + "string.singleLine": supported, + "string.multiLine": supported, + + "textFragment.comment.line": supported, + "textFragment.string.singleLine": supported, + "textFragment.string.multiLine": supported, + + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.constant": supported, "name.assignment": supported, + "name.assignment.compound": supported, + "name.command": supported, + "name.foreach": supported, + "name.function": supported, + "name.iteration.document": supported, + "name.iteration.block": supported, + + "value.variable": supported, + "value.constant": supported, "value.assignment": supported, + "value.assignment.compound": supported, + "value.mapPair": supported, + "value.mapPair.iteration": supported, + "value.foreach": supported, + "value.return": supported, + "value.switch": supported, + "value.iteration.block": supported, + "value.iteration.document": supported, + + "interior.function": supported, + "interior.if": supported, + "interior.switchCase": supported, + "interior.switch": supported, + "interior.for": supported, + "interior.foreach": supported, + "interior.while": supported, + + "key.mapPair": supported, + "key.mapPair.iteration": supported, + + command: supported, + + regularExpression: supported, + + disqualifyDelimiter: supported, + + "argumentList.actual.empty": supported, + "argumentList.actual.singleLine": supported, + "argumentList.actual.multiLine": supported, + + map: supported, + + /* NOT APPLICABLE */ + + // Classes, interfaces, methods, and constructors + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + class: notApplicable, + "class.iteration.document": notApplicable, + "class.iteration.class": notApplicable, + "functionCall.constructor": notApplicable, + "functionCall.method": notApplicable, + "functionCall.chain": notApplicable, + "functionCallee.constructor": notApplicable, + "functionCallee.method": notApplicable, + "functionCallee.chain": notApplicable, + "namedFunction.constructor": notApplicable, + "namedFunction.method": notApplicable, + "namedFunction.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.interface": notApplicable, + "statement.field.class": notApplicable, + "statement.field.interface": notApplicable, + "statement.constructor": notApplicable, + "statement.method": notApplicable, + "statement.method.interface": notApplicable, + "statement.static": notApplicable, + "statement.iteration.class": notApplicable, + "statement.iteration.interface": notApplicable, + "name.method": notApplicable, + "name.method.interface": notApplicable, + "name.constructor": notApplicable, + "name.class": notApplicable, + "name.interface": notApplicable, + "name.field.class": notApplicable, + "name.field.interface": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.iteration.class": notApplicable, + "name.iteration.interface": notApplicable, + "value.field.class": notApplicable, + "value.field.interface": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "value.iteration.class": notApplicable, + "type.return.method": notApplicable, + "type.field.class": notApplicable, + "type.field.interface": notApplicable, + "type.class": notApplicable, + "type.interface": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.interface": notApplicable, + "interior.class": notApplicable, + "interior.interface": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, + "interior.static": notApplicable, + fieldAccess: notApplicable, + + // Enums + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argument.actual.enum.iteration": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, + "functionCall.enum": notApplicable, + "functionCallee.enum": notApplicable, + "statement.enum": notApplicable, + "name.enum": notApplicable, + "name.field.enum": notApplicable, + "name.iteration.enum": notApplicable, + "value.field.enum": notApplicable, + "value.iteration.enum": notApplicable, + "type.enum": notApplicable, + "interior.enum": notApplicable, + + // Anonymous functions + anonymousFunction: notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "name.argument.formal.lambda": notApplicable, + "name.argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, + "type.argument.formal.lambda": notApplicable, + "type.argument.formal.lambda.iteration": notApplicable, + "interior.lambda": notApplicable, + + // Exceptions and try / catch + "argument.formal.catch": notApplicable, + "branch.try": notApplicable, + "branch.try.iteration": notApplicable, + "statement.try": notApplicable, + "statement.throw": notApplicable, + "name.argument.catch": notApplicable, + "value.throw": notApplicable, + "type.argument.catch": notApplicable, + "interior.try": notApplicable, + + // Formal parameters and default argument values + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + + // Keyword arguments + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "name.assignment.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, + "value.assignment.destructuring": notApplicable, + + // Type aliases + "statement.typeAlias": notApplicable, + "name.typeAlias": notApplicable, + "value.typeAlias": notApplicable, + "type.alias": notApplicable, + + // Type annotations and generic types + "functionCall.generic": notApplicable, + "functionCallee.generic": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, + "type.constant": notApplicable, + "type.return": notApplicable, + "type.foreach": notApplicable, + "type.cast": notApplicable, + "type.typeArgument": notApplicable, + "type.typeArgument.iteration": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.document": notApplicable, + + // Element and tags + "textFragment.element": notApplicable, + "value.attribute": notApplicable, + "interior.element": notApplicable, + element: notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + attribute: notApplicable, + "key.attribute": notApplicable, + + // Sections and document structure + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + chapter: notApplicable, + subSection: notApplicable, + subSubSection: notApplicable, + sectionLevelOne: notApplicable, + sectionLevelTwo: notApplicable, + sectionLevelThree: notApplicable, + sectionLevelFour: notApplicable, + sectionLevelFive: notApplicable, + sectionLevelSix: notApplicable, + namedParagraph: notApplicable, + subParagraph: notApplicable, + part: notApplicable, + + // Notebook cells + "interior.cell": notApplicable, + notebookCell: notApplicable, + + // Namespaces and package declarations + "statement.package": notApplicable, + "statement.namespace": notApplicable, + "name.namespace": notApplicable, + "interior.namespace": notApplicable, + + // Resource management blocks + "statement.resource": notApplicable, + "name.resource": notApplicable, + "value.resource": notApplicable, + "type.resource": notApplicable, + "interior.resource": notApplicable, + + // Generator yield + "statement.yield": notApplicable, + "value.yield": notApplicable, + + // Do-while loops + "condition.doWhile": notApplicable, + "statement.doWhile": notApplicable, + "interior.doWhile": notApplicable, + + // Loop else branches + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // Block comments + "comment.block": notApplicable, + "textFragment.comment.block": notApplicable, + + // Unenclosed comma-separated collections + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Command bodies (as in Talon) + "value.command": notApplicable, + "interior.command": notApplicable, + + // Markup environments, selectors, units, and custom delimiter pairs + pairDelimiter: notApplicable, + environment: notApplicable, + selector: notApplicable, + unit: notApplicable, }; From 98e116b674922fc079a133ff29202a1640aaf3d5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 12:49:31 +0200 Subject: [PATCH 05/26] update --- .../src/scopeSupportFacets/shellscript.ts | 9 ++- .../fixtures/scopes/shellscript/command.scope | 10 ---- .../scopes/shellscript/name.assignment.scope | 20 ------- .../scopes/shellscript/name.assignment2.scope | 20 ------- .../scopes/shellscript/name.assignment3.scope | 20 ------- .../name/name.assignment.compound.scope | 20 +++++++ .../shellscript/name/name.assignment.scope | 20 +++++++ .../shellscript/name/name.constant.scope | 20 +++++++ .../shellscript/name/name.foreach.scope | 24 ++++++++ .../shellscript/name/name.function.scope | 13 +++++ .../shellscript/name/name.function2.scope | 24 ++++++++ .../name/name.variable.initialized.scope | 20 +++++++ .../name/name.variable.initialized2.scope | 20 +++++++ .../name/name.variable.uninitialized.scope | 20 +++++++ .../name/name.variable.uninitialized2.scope | 20 +++++++ .../statement.assignment.compound.scope | 10 ++++ .../statement/statement.assignment.scope | 10 ++++ .../statement/statement.constant.scope | 10 ++++ .../statement/statement.foreach.scope | 10 ++++ .../statement/statement.function.scope | 10 ++++ .../statement/statement.function2.scope | 10 ++++ .../scopes/shellscript/value.assignment.scope | 20 ------- .../shellscript/value/value.foreach.scope | 20 +++++++ resources/queries/shellscript.scm | 56 +++++++++++-------- 24 files changed, 317 insertions(+), 119 deletions(-) delete mode 100644 resources/fixtures/scopes/shellscript/command.scope delete mode 100644 resources/fixtures/scopes/shellscript/name.assignment.scope delete mode 100644 resources/fixtures/scopes/shellscript/name.assignment2.scope delete mode 100644 resources/fixtures/scopes/shellscript/name.assignment3.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.assignment.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.constant.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.foreach.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.function.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.function2.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.variable.initialized.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.variable.initialized2.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.variable.uninitialized.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.variable.uninitialized2.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.assignment.compound.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.assignment.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.constant.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.foreach.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.function.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.function2.scope delete mode 100644 resources/fixtures/scopes/shellscript/value.assignment.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.foreach.scope diff --git a/packages/lib-common/src/scopeSupportFacets/shellscript.ts b/packages/lib-common/src/scopeSupportFacets/shellscript.ts index 605282c2da4..40978dd2567 100644 --- a/packages/lib-common/src/scopeSupportFacets/shellscript.ts +++ b/packages/lib-common/src/scopeSupportFacets/shellscript.ts @@ -54,7 +54,6 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "statement.return": supported, "statement.break": supported, "statement.continue": supported, - "statement.command": supported, "statement.import": supported, "statement.misc": supported, "statement.update": supported, @@ -73,7 +72,6 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "name.constant": supported, "name.assignment": supported, "name.assignment.compound": supported, - "name.command": supported, "name.foreach": supported, "name.function": supported, "name.iteration.document": supported, @@ -102,8 +100,6 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "key.mapPair": supported, "key.mapPair.iteration": supported, - command: supported, - regularExpression: supported, disqualifyDelimiter: supported, @@ -363,7 +359,10 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, - // Command bodies (as in Talon) + // Commands (as in Talon); shell invocations use calls and callees. + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, diff --git a/resources/fixtures/scopes/shellscript/command.scope b/resources/fixtures/scopes/shellscript/command.scope deleted file mode 100644 index ddcc99db10a..00000000000 --- a/resources/fixtures/scopes/shellscript/command.scope +++ /dev/null @@ -1,10 +0,0 @@ -echo "foo" ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:10 -0| echo "foo" - >----------< - -[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name.assignment.scope b/resources/fixtures/scopes/shellscript/name.assignment.scope deleted file mode 100644 index 8d80e210119..00000000000 --- a/resources/fixtures/scopes/shellscript/name.assignment.scope +++ /dev/null @@ -1,20 +0,0 @@ -local local_var="hello" ---- - -[Content] = 0:6-0:15 -0| local local_var="hello" - >---------< - -[Removal] = 0:0-0:16 -0| local local_var="hello" - >----------------< - -[Leading delimiter] = 0:5-0:6 -0| local local_var="hello" - >-< - -[Domain] = 0:0-0:23 -0| local local_var="hello" - >-----------------------< - -[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name.assignment2.scope b/resources/fixtures/scopes/shellscript/name.assignment2.scope deleted file mode 100644 index 8ebf2cfa109..00000000000 --- a/resources/fixtures/scopes/shellscript/name.assignment2.scope +++ /dev/null @@ -1,20 +0,0 @@ -declare local_var="hello" ---- - -[Content] = 0:8-0:17 -0| declare local_var="hello" - >---------< - -[Removal] = 0:0-0:18 -0| declare local_var="hello" - >------------------< - -[Leading delimiter] = 0:7-0:8 -0| declare local_var="hello" - >-< - -[Domain] = 0:0-0:25 -0| declare local_var="hello" - >-------------------------< - -[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name.assignment3.scope b/resources/fixtures/scopes/shellscript/name.assignment3.scope deleted file mode 100644 index 3260c937a00..00000000000 --- a/resources/fixtures/scopes/shellscript/name.assignment3.scope +++ /dev/null @@ -1,20 +0,0 @@ -local local_var ---- - -[Content] = 0:6-0:15 -0| local local_var - >---------< - -[Removal] = 0:5-0:15 -0| local local_var - >----------< - -[Leading delimiter] = 0:5-0:6 -0| local local_var - >-< - -[Domain] = 0:0-0:15 -0| local local_var - >---------------< - -[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope b/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope new file mode 100644 index 00000000000..cfd775237c1 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope @@ -0,0 +1,20 @@ +foo+=1 +--- + +[Content] = 0:0-0:3 + >---< +0| foo+=1 + +[Removal] = 0:0-0:5 + >-----< +0| foo+=1 + +[Trailing delimiter] = 0:3-0:5 + >--< +0| foo+=1 + +[Domain] = 0:0-0:6 + >------< +0| foo+=1 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.assignment.scope b/resources/fixtures/scopes/shellscript/name/name.assignment.scope new file mode 100644 index 00000000000..d4b5ad34a83 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.assignment.scope @@ -0,0 +1,20 @@ +foo=0 +--- + +[Content] = 0:0-0:3 + >---< +0| foo=0 + +[Removal] = 0:0-0:4 + >----< +0| foo=0 + +[Trailing delimiter] = 0:3-0:4 + >-< +0| foo=0 + +[Domain] = 0:0-0:5 + >-----< +0| foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.constant.scope b/resources/fixtures/scopes/shellscript/name/name.constant.scope new file mode 100644 index 00000000000..70fecbd1624 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.constant.scope @@ -0,0 +1,20 @@ +readonly foo=0 +--- + +[Content] = 0:9-0:12 + >---< +0| readonly foo=0 + +[Removal] = 0:0-0:13 + >-------------< +0| readonly foo=0 + +[Leading delimiter] = 0:8-0:9 + >-< +0| readonly foo=0 + +[Domain] = 0:0-0:14 + >--------------< +0| readonly foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.foreach.scope b/resources/fixtures/scopes/shellscript/name/name.foreach.scope new file mode 100644 index 00000000000..edbf686c05b --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.foreach.scope @@ -0,0 +1,24 @@ +for v in values; do foo; done +--- + +[Content] = 0:4-0:5 + >-< +0| for v in values; do foo; done + +[Removal] = 0:4-0:6 + >--< +0| for v in values; do foo; done + +[Leading delimiter] = 0:3-0:4 + >-< +0| for v in values; do foo; done + +[Trailing delimiter] = 0:5-0:6 + >-< +0| for v in values; do foo; done + +[Domain] = 0:0-0:29 + >-----------------------------< +0| for v in values; do foo; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.function.scope b/resources/fixtures/scopes/shellscript/name/name.function.scope new file mode 100644 index 00000000000..23835632d4c --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.function.scope @@ -0,0 +1,13 @@ +foo() {} +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo() {} + +[Domain] = 0:0-0:8 + >--------< +0| foo() {} + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.function2.scope b/resources/fixtures/scopes/shellscript/name/name.function2.scope new file mode 100644 index 00000000000..26008b01397 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.function2.scope @@ -0,0 +1,24 @@ +function foo {} +--- + +[Content] = 0:9-0:12 + >---< +0| function foo {} + +[Removal] = 0:9-0:13 + >----< +0| function foo {} + +[Leading delimiter] = 0:8-0:9 + >-< +0| function foo {} + +[Trailing delimiter] = 0:12-0:13 + >-< +0| function foo {} + +[Domain] = 0:0-0:15 + >---------------< +0| function foo {} + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.variable.initialized.scope b/resources/fixtures/scopes/shellscript/name/name.variable.initialized.scope new file mode 100644 index 00000000000..199289c1c72 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.variable.initialized.scope @@ -0,0 +1,20 @@ +local foo=0 +--- + +[Content] = 0:6-0:9 + >---< +0| local foo=0 + +[Removal] = 0:0-0:10 + >----------< +0| local foo=0 + +[Leading delimiter] = 0:5-0:6 + >-< +0| local foo=0 + +[Domain] = 0:0-0:11 + >-----------< +0| local foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.variable.initialized2.scope b/resources/fixtures/scopes/shellscript/name/name.variable.initialized2.scope new file mode 100644 index 00000000000..6882fd0c376 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.variable.initialized2.scope @@ -0,0 +1,20 @@ +declare foo=0 +--- + +[Content] = 0:8-0:11 + >---< +0| declare foo=0 + +[Removal] = 0:0-0:12 + >------------< +0| declare foo=0 + +[Leading delimiter] = 0:7-0:8 + >-< +0| declare foo=0 + +[Domain] = 0:0-0:13 + >-------------< +0| declare foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.variable.uninitialized.scope b/resources/fixtures/scopes/shellscript/name/name.variable.uninitialized.scope new file mode 100644 index 00000000000..ea092e785a4 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +declare foo +--- + +[Content] = 0:8-0:11 + >---< +0| declare foo + +[Removal] = 0:7-0:11 + >----< +0| declare foo + +[Leading delimiter] = 0:7-0:8 + >-< +0| declare foo + +[Domain] = 0:0-0:11 + >-----------< +0| declare foo + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.variable.uninitialized2.scope b/resources/fixtures/scopes/shellscript/name/name.variable.uninitialized2.scope new file mode 100644 index 00000000000..46082a20ce1 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.variable.uninitialized2.scope @@ -0,0 +1,20 @@ +local foo +--- + +[Content] = 0:6-0:9 + >---< +0| local foo + +[Removal] = 0:5-0:9 + >----< +0| local foo + +[Leading delimiter] = 0:5-0:6 + >-< +0| local foo + +[Domain] = 0:0-0:9 + >---------< +0| local foo + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/statement/statement.assignment.compound.scope b/resources/fixtures/scopes/shellscript/statement/statement.assignment.compound.scope new file mode 100644 index 00000000000..e2c1463f8e5 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.assignment.compound.scope @@ -0,0 +1,10 @@ +foo+=1 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:6 + >------< +0| foo+=1 + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.assignment.scope b/resources/fixtures/scopes/shellscript/statement/statement.assignment.scope new file mode 100644 index 00000000000..bc214c00006 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo=0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:5 + >-----< +0| foo=0 + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.constant.scope b/resources/fixtures/scopes/shellscript/statement/statement.constant.scope new file mode 100644 index 00000000000..c3ca8b71484 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.constant.scope @@ -0,0 +1,10 @@ +readonly foo=0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| readonly foo=0 + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope b/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope new file mode 100644 index 00000000000..aeec4f29cb8 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for v in values; do; done +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:25 + >-------------------------< +0| for v in values; do; done + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.function.scope b/resources/fixtures/scopes/shellscript/statement/statement.function.scope new file mode 100644 index 00000000000..27771a509bd --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.function.scope @@ -0,0 +1,10 @@ +foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo() {} + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.function2.scope b/resources/fixtures/scopes/shellscript/statement/statement.function2.scope new file mode 100644 index 00000000000..8e3f364473f --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.function2.scope @@ -0,0 +1,10 @@ +function foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| function foo {} + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/value.assignment.scope b/resources/fixtures/scopes/shellscript/value.assignment.scope deleted file mode 100644 index 18456d54cd4..00000000000 --- a/resources/fixtures/scopes/shellscript/value.assignment.scope +++ /dev/null @@ -1,20 +0,0 @@ -local name="Hello world" ---- - -[Content] = 0:11-0:24 -0| local name="Hello world" - >-------------< - -[Removal] = 0:10-0:24 -0| local name="Hello world" - >--------------< - -[Leading delimiter] = 0:10-0:11 -0| local name="Hello world" - >-< - -[Domain] = 0:0-0:24 -0| local name="Hello world" - >------------------------< - -[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.foreach.scope b/resources/fixtures/scopes/shellscript/value/value.foreach.scope new file mode 100644 index 00000000000..e85d5d75c01 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.foreach.scope @@ -0,0 +1,20 @@ +for v in values; do foo; done +--- + +[Content] = 0:9-0:15 + >------< +0| for v in values; do foo; done + +[Removal] = 0:8-0:15 + >-------< +0| for v in values; do foo; done + +[Leading delimiter] = 0:8-0:9 + >-< +0| for v in values; do foo; done + +[Domain] = 0:0-0:29 + >-----------------------------< +0| for v in values; do foo; done + +[Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 0dcd771648d..9b7a5b4c41a 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -31,6 +31,14 @@ ) ) +;;!! for v in values; do foo; done +;;! ^ +;;! ^^^^^^ +(for_statement + variable: (_) @name + value: (_) @value +) @_.domain + ;; ;; Conditionals ;; @@ -74,12 +82,12 @@ (if_statement "if" @condition.domain.start.startOf @branch.start.startOf (_) @condition - "then" @branch.interior.start.endOf - (_) @dummy + "then" @interior.start.endOf + (_) @_dummy . - "fi" @condition.domain.end.startOf @branch.end.startOf @branch.interior.end.startOf + "fi" @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf ) - (#not-type? @dummy else_clause elif_clause) + (#not-type? @_dummy else_clause elif_clause) ) ;;!! if [ $value -le 0 ]; then @@ -90,9 +98,9 @@ (if_statement "if" @condition.domain.start.startOf @branch.start.startOf (_) @condition - "then" @branch.interior.start.endOf + "then" @interior.start.endOf (_) - (elif_clause) @condition.domain.end.startOf @branch.end.startOf @branch.interior.end.startOf + (elif_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf ) ) @@ -104,12 +112,12 @@ (if_statement "if" @condition.domain.start.startOf @branch.start.startOf (_) @condition - "then" @branch.interior.start.endOf - (_) @dummy + "then" @interior.start.endOf + (_) @_dummy . - (else_clause) @condition.domain.end.startOf @branch.end.startOf @branch.interior.end.startOf + (else_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf ) - (#not-type? @dummy elif_clause) + (#not-type? @_dummy elif_clause) ) ;;!! elif [ $value -le 0 ]; then @@ -125,9 +133,9 @@ ;;!! echo "foo1" (elif_clause (_) @condition - "then" @branch.interior.start.endOf + "then" @interior.start.endOf (_) -) @branch @_.domain @branch.interior.end.endOf +) @branch @_.domain @interior.end.endOf ;;!! else ;;!! fi @@ -141,9 +149,9 @@ ;;!! echo "foo1" ;;!! fi (else_clause - "else" @branch.interior.start.endOf + "else" @interior.start.endOf (_) -) @branch @branch.interior.end.endOf +) @branch @interior.end.endOf (_ condition: (_) @condition @@ -153,8 +161,8 @@ (case_item value: (_) @condition . - ")" @branch.interior.start.endOf - (_) @branch.interior.end.endOf + ")" @interior.start.endOf + (_) @interior.end.endOf . ";;" ) @branch @_.domain @@ -166,9 +174,9 @@ ;;! ^^^^^^^^^^^^^ ;;! ------------- (array - "(" @_.interior.start.endOf + "(" @interior.start.endOf (_)? @collectionItem - ")" @_.interior.end.startOf + ")" @interior.end.startOf ) @list @collectionItem.iteration ;;!! FIXME: I will file an issue in tree-sitter-bash as I think the grammar is @@ -178,10 +186,10 @@ ( (concatenation ;; This matches the [ which is (word) for some reason - (_) @collectionKey.leading.start + (_) @collectionKey.leading.startOf (_) @collectionKey ;; This matches the ] which is also (word) for some reason - (_) @collectionKey.trailing.end + (_) @collectionKey.trailing.endOf (_) @value ) @collectionItem (#shrink-to-match! @value "\=(?.*)") @@ -245,7 +253,7 @@ ;;!! } ;;! - (function_definition - name: (_) @functionName + name: (_) @name ) @_.domain ;; FIXME: Need to support redirections @@ -259,7 +267,7 @@ ;;! - (function_definition body: (_ - (_)? @_.interior + (_)? @interior ) ) @namedFunction @_.domain @@ -275,8 +283,8 @@ (variable_assignment name: (_) @name @value.leading.endOf value: (_) @value @name.trailing.startOf - ) @dummy @_.domain - (#not-parent-type? @dummy declaration_command) + ) @_dummy @_.domain + (#not-parent-type? @_dummy declaration_command) ) ;;!! local foo="bar" From ec07b6b3bd5a2e37c527f745b912f2814e414f26 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 12:57:28 +0200 Subject: [PATCH 06/26] string --- .../name/name.assignment.compound.scope | 10 +++++----- .../scopes/shellscript/string.multiLine.scope | 13 ++++++++++++ .../shellscript/string.singleLine.scope | 10 ++++++++++ .../textFragment.comment.line.scope | 10 ++++++++++ .../textFragment.string.multiLine.scope | 13 ++++++++++++ .../textFragment.string.singleLine.scope | 10 ++++++++++ .../value/value.assignment.compound.scope | 20 +++++++++++++++++++ .../shellscript/value/value.assignment.scope | 20 +++++++++++++++++++ .../shellscript/value/value.constant.scope | 20 +++++++++++++++++++ .../shellscript/value/value.variable.scope | 20 +++++++++++++++++++ .../shellscript/value/value.variable2.scope | 20 +++++++++++++++++++ resources/queries/shellscript.scm | 7 ++++++- 12 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/string.multiLine.scope create mode 100644 resources/fixtures/scopes/shellscript/string.singleLine.scope create mode 100644 resources/fixtures/scopes/shellscript/textFragment.comment.line.scope create mode 100644 resources/fixtures/scopes/shellscript/textFragment.string.multiLine.scope create mode 100644 resources/fixtures/scopes/shellscript/textFragment.string.singleLine.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.assignment.compound.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.assignment.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.constant.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.variable.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.variable2.scope diff --git a/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope b/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope index cfd775237c1..58b54b8ae7a 100644 --- a/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope +++ b/resources/fixtures/scopes/shellscript/name/name.assignment.compound.scope @@ -1,20 +1,20 @@ -foo+=1 +foo+=0 --- [Content] = 0:0-0:3 >---< -0| foo+=1 +0| foo+=0 [Removal] = 0:0-0:5 >-----< -0| foo+=1 +0| foo+=0 [Trailing delimiter] = 0:3-0:5 >--< -0| foo+=1 +0| foo+=0 [Domain] = 0:0-0:6 >------< -0| foo+=1 +0| foo+=0 [Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/string.multiLine.scope b/resources/fixtures/scopes/shellscript/string.multiLine.scope new file mode 100644 index 00000000000..e8f7baaa0aa --- /dev/null +++ b/resources/fixtures/scopes/shellscript/string.multiLine.scope @@ -0,0 +1,13 @@ +"Hello +world" +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:6 + >------ +0| "Hello +1| world" + ------< + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/string.singleLine.scope b/resources/fixtures/scopes/shellscript/string.singleLine.scope new file mode 100644 index 00000000000..4b26cf31b3c --- /dev/null +++ b/resources/fixtures/scopes/shellscript/string.singleLine.scope @@ -0,0 +1,10 @@ +"Hello world" +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| "Hello world" + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/textFragment.comment.line.scope b/resources/fixtures/scopes/shellscript/textFragment.comment.line.scope new file mode 100644 index 00000000000..2c362ef4153 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/textFragment.comment.line.scope @@ -0,0 +1,10 @@ +# Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| # Hello world + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/textFragment.string.multiLine.scope b/resources/fixtures/scopes/shellscript/textFragment.string.multiLine.scope new file mode 100644 index 00000000000..2780f7ce95f --- /dev/null +++ b/resources/fixtures/scopes/shellscript/textFragment.string.multiLine.scope @@ -0,0 +1,13 @@ +"Hello +world" +--- + +[Content] = +[Removal] = +[Domain] = 0:1-1:5 + >----- +0| "Hello +1| world" + -----< + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/textFragment.string.singleLine.scope b/resources/fixtures/scopes/shellscript/textFragment.string.singleLine.scope new file mode 100644 index 00000000000..85dcf5fa7fe --- /dev/null +++ b/resources/fixtures/scopes/shellscript/textFragment.string.singleLine.scope @@ -0,0 +1,10 @@ +"Hello world" +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:12 + >-----------< +0| "Hello world" + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.assignment.compound.scope b/resources/fixtures/scopes/shellscript/value/value.assignment.compound.scope new file mode 100644 index 00000000000..36f9cc162c1 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.assignment.compound.scope @@ -0,0 +1,20 @@ +foo+=0 +--- + +[Content] = 0:5-0:6 + >-< +0| foo+=0 + +[Removal] = 0:3-0:6 + >---< +0| foo+=0 + +[Leading delimiter] = 0:3-0:5 + >--< +0| foo+=0 + +[Domain] = 0:0-0:6 + >------< +0| foo+=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.assignment.scope b/resources/fixtures/scopes/shellscript/value/value.assignment.scope new file mode 100644 index 00000000000..d394b2b757e --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.assignment.scope @@ -0,0 +1,20 @@ +foo=0 +--- + +[Content] = 0:4-0:5 + >-< +0| foo=0 + +[Removal] = 0:3-0:5 + >--< +0| foo=0 + +[Leading delimiter] = 0:3-0:4 + >-< +0| foo=0 + +[Domain] = 0:0-0:5 + >-----< +0| foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.constant.scope b/resources/fixtures/scopes/shellscript/value/value.constant.scope new file mode 100644 index 00000000000..7c3986b198b --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.constant.scope @@ -0,0 +1,20 @@ +readonly foo=0 +--- + +[Content] = 0:13-0:14 + >-< +0| readonly foo=0 + +[Removal] = 0:12-0:14 + >--< +0| readonly foo=0 + +[Leading delimiter] = 0:12-0:13 + >-< +0| readonly foo=0 + +[Domain] = 0:0-0:14 + >--------------< +0| readonly foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.variable.scope b/resources/fixtures/scopes/shellscript/value/value.variable.scope new file mode 100644 index 00000000000..b440796c7ba --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.variable.scope @@ -0,0 +1,20 @@ +local foo=0 +--- + +[Content] = 0:10-0:11 + >-< +0| local foo=0 + +[Removal] = 0:9-0:11 + >--< +0| local foo=0 + +[Leading delimiter] = 0:9-0:10 + >-< +0| local foo=0 + +[Domain] = 0:0-0:11 + >-----------< +0| local foo=0 + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.variable2.scope b/resources/fixtures/scopes/shellscript/value/value.variable2.scope new file mode 100644 index 00000000000..c09311a2ff6 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.variable2.scope @@ -0,0 +1,20 @@ +declare foo=0 +--- + +[Content] = 0:12-0:13 + >-< +0| declare foo=0 + +[Removal] = 0:11-0:13 + >--< +0| declare foo=0 + +[Leading delimiter] = 0:11-0:12 + >-< +0| declare foo=0 + +[Domain] = 0:0-0:13 + >-------------< +0| declare foo=0 + +[Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 9b7a5b4c41a..997c79f7889 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -206,7 +206,12 @@ ;;!! var="foo" ;;! ^^^^^ -(string) @string @textFragment +(string + . + (string_content) @textFragment.start + (string_content)? @textFragment.end + . +) @string ;;!! var="foo ${bar}" ;;! ^^^^^^ From f8c7affc8802b2a7292f5492927f58b8532fe031 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 13:37:10 +0200 Subject: [PATCH 07/26] update --- .../shellscript/condition/condition.if.scope | 46 ++++ .../condition/condition.ternary.scope | 20 ++ .../condition/condition.while.scope | 20 ++ .../condition/condition.while2.scope | 20 ++ .../scopes/shellscript/functionCall.scope | 10 + .../scopes/shellscript/functionCall2.scope | 10 + .../scopes/shellscript/functionCallee.scope | 10 + .../scopes/shellscript/functionCallee2.scope | 20 ++ .../scopes/shellscript/ifStatement.scope | 17 ++ .../shellscript/name/name.foreach.scope | 16 +- .../statement/statement.break.scope | 33 +++ .../statement/statement.continue.scope | 33 +++ .../statement/statement.foreach.scope | 30 ++- .../statement/statement.functionCall.scope | 10 + .../statement/statement.functionCall2.scope | 10 + .../shellscript/statement/statement.if.scope | 17 ++ .../statement.iteration.document.scope | 12 + .../statement/statement.while.scope | 26 ++ .../statement/statement.while2.scope | 26 ++ .../shellscript/value/value.foreach.scope | 14 +- resources/queries/shellscript.scm | 249 +++++++++--------- 21 files changed, 504 insertions(+), 145 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.if.scope create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.ternary.scope create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.while.scope create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.while2.scope create mode 100644 resources/fixtures/scopes/shellscript/functionCall.scope create mode 100644 resources/fixtures/scopes/shellscript/functionCall2.scope create mode 100644 resources/fixtures/scopes/shellscript/functionCallee.scope create mode 100644 resources/fixtures/scopes/shellscript/functionCallee2.scope create mode 100644 resources/fixtures/scopes/shellscript/ifStatement.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.break.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.continue.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.functionCall.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.functionCall2.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.if.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.iteration.document.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.while.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.while2.scope diff --git a/resources/fixtures/scopes/shellscript/condition/condition.if.scope b/resources/fixtures/scopes/shellscript/condition/condition.if.scope new file mode 100644 index 00000000000..a67d508a880 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.if.scope @@ -0,0 +1,46 @@ +if true; then +elif false; then +else +fi +--- + +[#1 Content] = 0:3-0:7 + >----< +0| if true; then + +[#1 Removal] = 0:2-0:7 + >-----< +0| if true; then + +[#1 Leading delimiter] = 0:2-0:3 + >-< +0| if true; then + +[#1 Domain] = 0:0-3:2 + >------------- +0| if true; then +1| elif false; then +2| else +3| fi + --< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:5-1:10 + >-----< +1| elif false; then + +[#2 Removal] = 1:4-1:10 + >------< +1| elif false; then + +[#2 Leading delimiter] = 1:4-1:5 + >-< +1| elif false; then + +[#2 Domain] = 1:0-1:16 + >----------------< +1| elif false; then + +[#2 Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/condition/condition.ternary.scope b/resources/fixtures/scopes/shellscript/condition/condition.ternary.scope new file mode 100644 index 00000000000..dd10d78891a --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.ternary.scope @@ -0,0 +1,20 @@ +((true ? 0 : 1)) +--- + +[Content] = 0:2-0:6 + >----< +0| ((true ? 0 : 1)) + +[Removal] = 0:2-0:7 + >-----< +0| ((true ? 0 : 1)) + +[Trailing delimiter] = 0:6-0:7 + >-< +0| ((true ? 0 : 1)) + +[Domain] = 0:2-0:14 + >------------< +0| ((true ? 0 : 1)) + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/condition/condition.while.scope b/resources/fixtures/scopes/shellscript/condition/condition.while.scope new file mode 100644 index 00000000000..4616dcdca98 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.while.scope @@ -0,0 +1,20 @@ +while true; do :; done +--- + +[Content] = 0:6-0:10 + >----< +0| while true; do :; done + +[Removal] = 0:5-0:10 + >-----< +0| while true; do :; done + +[Leading delimiter] = 0:5-0:6 + >-< +0| while true; do :; done + +[Domain] = 0:0-0:22 + >----------------------< +0| while true; do :; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/condition/condition.while2.scope b/resources/fixtures/scopes/shellscript/condition/condition.while2.scope new file mode 100644 index 00000000000..eb65d51f95d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.while2.scope @@ -0,0 +1,20 @@ +until true; do :; done +--- + +[Content] = 0:6-0:10 + >----< +0| until true; do :; done + +[Removal] = 0:5-0:10 + >-----< +0| until true; do :; done + +[Leading delimiter] = 0:5-0:6 + >-< +0| until true; do :; done + +[Domain] = 0:0-0:22 + >----------------------< +0| until true; do :; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/functionCall.scope b/resources/fixtures/scopes/shellscript/functionCall.scope new file mode 100644 index 00000000000..112d8624cf7 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/functionCall.scope @@ -0,0 +1,10 @@ +foo +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:3 + >---< +0| foo + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/functionCall2.scope b/resources/fixtures/scopes/shellscript/functionCall2.scope new file mode 100644 index 00000000000..0f47076007a --- /dev/null +++ b/resources/fixtures/scopes/shellscript/functionCall2.scope @@ -0,0 +1,10 @@ +foo aaa bbb +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| foo aaa bbb + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/functionCallee.scope b/resources/fixtures/scopes/shellscript/functionCallee.scope new file mode 100644 index 00000000000..112d8624cf7 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/functionCallee.scope @@ -0,0 +1,10 @@ +foo +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:3 + >---< +0| foo + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/functionCallee2.scope b/resources/fixtures/scopes/shellscript/functionCallee2.scope new file mode 100644 index 00000000000..3ab340cc86d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/functionCallee2.scope @@ -0,0 +1,20 @@ +foo aaa bbb +--- + +[Content] = 0:0-0:3 + >---< +0| foo aaa bbb + +[Removal] = 0:0-0:4 + >----< +0| foo aaa bbb + +[Trailing delimiter] = 0:3-0:4 + >-< +0| foo aaa bbb + +[Domain] = 0:0-0:11 + >-----------< +0| foo aaa bbb + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/ifStatement.scope b/resources/fixtures/scopes/shellscript/ifStatement.scope new file mode 100644 index 00000000000..8f054040c66 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/ifStatement.scope @@ -0,0 +1,17 @@ +if true; then +elif false; then +else +fi +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:2 + >------------- +0| if true; then +1| elif false; then +2| else +3| fi + --< + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/name/name.foreach.scope b/resources/fixtures/scopes/shellscript/name/name.foreach.scope index edbf686c05b..7595e725f97 100644 --- a/resources/fixtures/scopes/shellscript/name/name.foreach.scope +++ b/resources/fixtures/scopes/shellscript/name/name.foreach.scope @@ -1,24 +1,24 @@ -for v in values; do foo; done +for v in values; do :; done --- [Content] = 0:4-0:5 >-< -0| for v in values; do foo; done +0| for v in values; do :; done [Removal] = 0:4-0:6 >--< -0| for v in values; do foo; done +0| for v in values; do :; done [Leading delimiter] = 0:3-0:4 >-< -0| for v in values; do foo; done +0| for v in values; do :; done [Trailing delimiter] = 0:5-0:6 >-< -0| for v in values; do foo; done +0| for v in values; do :; done -[Domain] = 0:0-0:29 - >-----------------------------< -0| for v in values; do foo; done +[Domain] = 0:0-0:27 + >---------------------------< +0| for v in values; do :; done [Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/statement/statement.break.scope b/resources/fixtures/scopes/shellscript/statement/statement.break.scope new file mode 100644 index 00000000000..c697e2b0daa --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.break.scope @@ -0,0 +1,33 @@ +while true; do + break +done +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:4 + >-------------- +0| while true; do +1| break +2| done + ----< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| break + +[#2 Removal] = 1:0-2:0 + >--------- +1| break +2| done + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.continue.scope b/resources/fixtures/scopes/shellscript/statement/statement.continue.scope new file mode 100644 index 00000000000..6c6d30c7e14 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.continue.scope @@ -0,0 +1,33 @@ +while true; do + continue +done +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:4 + >-------------- +0| while true; do +1| continue +2| done + ----< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| continue + +[#2 Removal] = 1:0-2:0 + >------------ +1| continue +2| done + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope b/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope index aeec4f29cb8..db884dca010 100644 --- a/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope +++ b/resources/fixtures/scopes/shellscript/statement/statement.foreach.scope @@ -1,10 +1,26 @@ -for v in values; do; done +for v in values; do :; done --- -[Content] = -[Removal] = -[Domain] = 0:0-0:25 - >-------------------------< -0| for v in values; do; done +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:27 + >---------------------------< +0| for v in values; do :; done -[Insertion delimiter] = "\n" +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:20-0:21 + >-< +0| for v in values; do :; done + +[#2 Removal] = 0:19-0:21 + >--< +0| for v in values; do :; done + +[#2 Leading delimiter] = 0:19-0:20 + >-< +0| for v in values; do :; done + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.functionCall.scope b/resources/fixtures/scopes/shellscript/statement/statement.functionCall.scope new file mode 100644 index 00000000000..56385bcce4d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.functionCall.scope @@ -0,0 +1,10 @@ +foo +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:3 + >---< +0| foo + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.functionCall2.scope b/resources/fixtures/scopes/shellscript/statement/statement.functionCall2.scope new file mode 100644 index 00000000000..54dce4076a3 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.functionCall2.scope @@ -0,0 +1,10 @@ +foo aaa bbb +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| foo aaa bbb + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.if.scope b/resources/fixtures/scopes/shellscript/statement/statement.if.scope new file mode 100644 index 00000000000..8f054040c66 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.if.scope @@ -0,0 +1,17 @@ +if true; then +elif false; then +else +fi +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:2 + >------------- +0| if true; then +1| elif false; then +2| else +3| fi + --< + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.iteration.document.scope b/resources/fixtures/scopes/shellscript/statement/statement.iteration.document.scope new file mode 100644 index 00000000000..c73f4c1df8f --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.iteration.document.scope @@ -0,0 +1,12 @@ + +declare foo + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| declare foo +2| + < diff --git a/resources/fixtures/scopes/shellscript/statement/statement.while.scope b/resources/fixtures/scopes/shellscript/statement/statement.while.scope new file mode 100644 index 00000000000..bffa529eff4 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.while.scope @@ -0,0 +1,26 @@ +while true; do :; done +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| while true; do :; done + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:15-0:16 + >-< +0| while true; do :; done + +[#2 Removal] = 0:14-0:16 + >--< +0| while true; do :; done + +[#2 Leading delimiter] = 0:14-0:15 + >-< +0| while true; do :; done + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.while2.scope b/resources/fixtures/scopes/shellscript/statement/statement.while2.scope new file mode 100644 index 00000000000..0a662e56f77 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.while2.scope @@ -0,0 +1,26 @@ +until true; do :; done +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| until true; do :; done + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:15-0:16 + >-< +0| until true; do :; done + +[#2 Removal] = 0:14-0:16 + >--< +0| until true; do :; done + +[#2 Leading delimiter] = 0:14-0:15 + >-< +0| until true; do :; done + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/value/value.foreach.scope b/resources/fixtures/scopes/shellscript/value/value.foreach.scope index e85d5d75c01..998c653f280 100644 --- a/resources/fixtures/scopes/shellscript/value/value.foreach.scope +++ b/resources/fixtures/scopes/shellscript/value/value.foreach.scope @@ -1,20 +1,20 @@ -for v in values; do foo; done +for v in values; do :; done --- [Content] = 0:9-0:15 >------< -0| for v in values; do foo; done +0| for v in values; do :; done [Removal] = 0:8-0:15 >-------< -0| for v in values; do foo; done +0| for v in values; do :; done [Leading delimiter] = 0:8-0:9 >-< -0| for v in values; do foo; done +0| for v in values; do :; done -[Domain] = 0:0-0:29 - >-----------------------------< -0| for v in values; do foo; done +[Domain] = 0:0-0:27 + >---------------------------< +0| for v in values; do :; done [Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 997c79f7889..9498023ed51 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -2,12 +2,13 @@ ;; Statements ;; -( - (program - (_) @statement - ) - (#not-type? @statement comment) -) +;; ( +;; (program +;; (_) @statement +;; ) +;; (#not-type? @statement comment) +;; ) + [ (if_statement) (while_statement) @@ -20,18 +21,31 @@ (redirected_statement) ] @statement -;;FIXME: Make the #not-parent-type? thing a list of nodes ( (_ [ (variable_assignment) (command) ] @statement - (#not-parent-type? @statement declaration_command c_style_for_statement list redirected_statement) + (#not-parent-type? + @statement + declaration_command + c_style_for_statement + list + redirected_statement + if_statement + elif_clause + while_statement + ) ) ) -;;!! for v in values; do foo; done +( + (program) @statement.iteration + (#document-range! @statement.iteration) +) + +;;!! for v in values; do :; done ;;! ^ ;;! ^^^^^^ (for_statement @@ -39,133 +53,122 @@ value: (_) @value ) @_.domain -;; -;; Conditionals -;; - -(if_statement) @ifStatement @branch.iteration @condition.iteration +;;!! while true; do :; done +;;! ^^^^ +(while_statement + condition: (_) @condition +) @_.domain -;;!! if [ $value -le 0 ]; then -;;!! fi +;;!! if true; then :; fi +;;! ^^^^ (if_statement - "if" @condition.domain.start.startOf @branch.start.startOf - (_) @condition - "then" @condition.domain.end.endOf @branch.end.endOf - . - "fi" -) + condition: (_) @condition +) @_.domain -;;!! if [ $value -le 0 ]; then -;;!! else -(if_statement - "if" @condition.domain.start.startOf @branch.start.startOf +;;!! elif false; then +;;! ^^^^^ +(elif_clause (_) @condition - "then" @condition.domain.end.endOf @branch.end.endOf - . - (else_clause) -) + "then" +) @branch @_.domain -;;!! if [ $value -le 0 ]; then -;;!! elif -(if_statement - "if" @condition.domain.start.startOf @branch.start.startOf - (_) @condition - "then" @condition.domain.end.endOf @branch.end.endOf - . - (elif_clause) -) +;;!! else :; fi +(else_clause) @branch + +(ternary_expression + condition: (_) @condition +) @_.domain + +;; +;; Conditionals +;; + +(if_statement) @ifStatement @branch.iteration @condition.iteration ;;!! if [ $value -le 0 ]; then ;;!! echo foo ;;!! fi -( - (if_statement - "if" @condition.domain.start.startOf @branch.start.startOf - (_) @condition - "then" @interior.start.endOf - (_) @_dummy - . - "fi" @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf - ) - (#not-type? @_dummy else_clause elif_clause) -) +;; ( +;; (if_statement +;; "if" @condition.domain.start.startOf @branch.start.startOf +;; (_) @condition +;; "then" @interior.start.endOf +;; (_) @_dummy +;; . +;; "fi" @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf +;; ) +;; (#not-type? @_dummy else_clause elif_clause) +;; ) ;;!! if [ $value -le 0 ]; then ;;!! echo foo ;;!! elif [ $value -le 0 ]; then ;;!! fi -( - (if_statement - "if" @condition.domain.start.startOf @branch.start.startOf - (_) @condition - "then" @interior.start.endOf - (_) - (elif_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf - ) -) +;; ( +;; (if_statement +;; "if" @condition.domain.start.startOf @branch.start.startOf +;; (_) @condition +;; "then" @interior.start.endOf +;; (_) +;; (elif_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf +;; ) +;; ) ;;!! if [ $value -le 0 ]; then ;;!! echo foo ;;!! else [ $value -le 0 ]; then ;;!! fi -( - (if_statement - "if" @condition.domain.start.startOf @branch.start.startOf - (_) @condition - "then" @interior.start.endOf - (_) @_dummy - . - (else_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf - ) - (#not-type? @_dummy elif_clause) -) +;; ( +;; (if_statement +;; "if" @condition.domain.start.startOf @branch.start.startOf +;; (_) @condition +;; "then" @interior.start.endOf +;; (_) @_dummy +;; . +;; (else_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf +;; ) +;; (#not-type? @_dummy elif_clause) +;; ) ;;!! elif [ $value -le 0 ]; then ;;!! else -(elif_clause - (_) @condition - "then" - . -) @branch @_.domain +;; (elif_clause +;; (_) @condition +;; "then" +;; . +;; ) @branch @_.domain ;;!! elif [ $value -le 0 ]; then ;;!! echo "foo1" ;;!! echo "foo1" -(elif_clause - (_) @condition - "then" @interior.start.endOf - (_) -) @branch @_.domain @interior.end.endOf - -;;!! else -;;!! fi -(else_clause - "else" - . -) @branch +;; (elif_clause +;; (_) @condition +;; "then" @interior.start.endOf +;; (_) +;; ) @branch @_.domain @interior.end.endOf ;;!! else ;;!! echo "foo1" ;;!! echo "foo1" ;;!! fi -(else_clause - "else" @interior.start.endOf - (_) -) @branch @interior.end.endOf - -(_ - condition: (_) @condition -) - -(case_statement) @branch.iteration @condition.iteration -(case_item - value: (_) @condition - . - ")" @interior.start.endOf - (_) @interior.end.endOf - . - ";;" -) @branch @_.domain +;; (else_clause +;; "else" @interior.start.endOf +;; (_) +;; ) @branch @interior.end.endOf + +;; (_ +;; condition: (_) @condition +;; ) + +;; (case_statement) @branch.iteration @condition.iteration +;; (case_item +;; value: (_) @condition +;; . +;; ")" @interior.start.endOf +;; (_) @interior.end.endOf +;; . +;; ";;" +;; ) @branch @_.domain ;; Lists and maps ;; @@ -173,28 +176,28 @@ ;;!! array=("a" "b" "c") ;;! ^^^^^^^^^^^^^ ;;! ------------- -(array - "(" @interior.start.endOf - (_)? @collectionItem - ")" @interior.end.startOf -) @list @collectionItem.iteration +;; (array +;; "(" @interior.start.endOf +;; (_)? @collectionItem +;; ")" @interior.end.startOf +;; ) @list @collectionItem.iteration ;;!! FIXME: I will file an issue in tree-sitter-bash as I think the grammar is ;;!! bad. But the below does work for now ;;!! arr+=(["key2"]=val2 ["key3"]=val3) -(array - ( - (concatenation - ;; This matches the [ which is (word) for some reason - (_) @collectionKey.leading.startOf - (_) @collectionKey - ;; This matches the ] which is also (word) for some reason - (_) @collectionKey.trailing.endOf - (_) @value - ) @collectionItem - (#shrink-to-match! @value "\=(?.*)") - ) -) +;; (array +;; ( +;; (concatenation +;; ;; This matches the [ which is (word) for some reason +;; (_) @collectionKey.leading.startOf +;; (_) @collectionKey +;; ;; This matches the ] which is also (word) for some reason +;; (_) @collectionKey.trailing.endOf +;; (_) @value +;; ) @collectionItem +;; (#shrink-to-match! @value "\=(?.*)") +;; ) +;; ) ;; ;; Strings From 049c9253e3d136a9e961e824cf554a2ea992e185 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 13:54:30 +0200 Subject: [PATCH 08/26] for --- .../scopes/shellscript/comment.line.scope | 10 +++++ .../shellscript/condition/condition.for.scope | 20 +++++++++ .../shellscript/regularExpression.scope | 21 ++++++++++ .../shellscript/statement/statement.for.scope | 26 ++++++++++++ .../statement/statement.import.scope | 10 +++++ .../statement/statement.return.scope | 33 +++++++++++++++ .../statement/statement.return2.scope | 33 +++++++++++++++ resources/queries/shellscript.scm | 41 +++++++++++-------- 8 files changed, 177 insertions(+), 17 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/comment.line.scope create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.for.scope create mode 100644 resources/fixtures/scopes/shellscript/regularExpression.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.for.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.import.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.return.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.return2.scope diff --git a/resources/fixtures/scopes/shellscript/comment.line.scope b/resources/fixtures/scopes/shellscript/comment.line.scope new file mode 100644 index 00000000000..42719cdbb87 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/comment.line.scope @@ -0,0 +1,10 @@ +# Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| # Hello world + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/condition/condition.for.scope b/resources/fixtures/scopes/shellscript/condition/condition.for.scope new file mode 100644 index 00000000000..f4b8efd5fda --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.for.scope @@ -0,0 +1,20 @@ +for ((i = 0; i < 2; i++)); do :; done +--- + +[Content] = 0:13-0:18 + >-----< +0| for ((i = 0; i < 2; i++)); do :; done + +[Removal] = 0:12-0:18 + >------< +0| for ((i = 0; i < 2; i++)); do :; done + +[Leading delimiter] = 0:12-0:13 + >-< +0| for ((i = 0; i < 2; i++)); do :; done + +[Domain] = 0:0-0:37 + >-------------------------------------< +0| for ((i = 0; i < 2; i++)); do :; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/regularExpression.scope b/resources/fixtures/scopes/shellscript/regularExpression.scope new file mode 100644 index 00000000000..c41400363c0 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/regularExpression.scope @@ -0,0 +1,21 @@ +[[ $foo =~ ^\w+$ ]] +--- + +[Content] = +[Domain] = 0:11-0:16 + >-----< +0| [[ $foo =~ ^\w+$ ]] + +[Removal] = 0:11-0:17 + >------< +0| [[ $foo =~ ^\w+$ ]] + +[Leading delimiter] = 0:10-0:11 + >-< +0| [[ $foo =~ ^\w+$ ]] + +[Trailing delimiter] = 0:16-0:17 + >-< +0| [[ $foo =~ ^\w+$ ]] + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/statement/statement.for.scope b/resources/fixtures/scopes/shellscript/statement/statement.for.scope new file mode 100644 index 00000000000..94a2090df0c --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.for.scope @@ -0,0 +1,26 @@ +for ((i = 0; i < 2; i++)); do :; done +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:37 + >-------------------------------------< +0| for ((i = 0; i < 2; i++)); do :; done + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:30-0:31 + >-< +0| for ((i = 0; i < 2; i++)); do :; done + +[#2 Removal] = 0:29-0:31 + >--< +0| for ((i = 0; i < 2; i++)); do :; done + +[#2 Leading delimiter] = 0:29-0:30 + >-< +0| for ((i = 0; i < 2; i++)); do :; done + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.import.scope b/resources/fixtures/scopes/shellscript/statement/statement.import.scope new file mode 100644 index 00000000000..7437db33ae1 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.import.scope @@ -0,0 +1,10 @@ +source foo.sh +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| source foo.sh + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.return.scope b/resources/fixtures/scopes/shellscript/statement/statement.return.scope new file mode 100644 index 00000000000..c826bddb976 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.return.scope @@ -0,0 +1,33 @@ +foo() { + return 0 +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------- +0| foo() { +1| return 0 +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| return 0 + +[#2 Removal] = 1:0-2:0 + >------------ +1| return 0 +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0 + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.return2.scope b/resources/fixtures/scopes/shellscript/statement/statement.return2.scope new file mode 100644 index 00000000000..a139463f2c8 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.return2.scope @@ -0,0 +1,33 @@ +function foo { + return 0 +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| function foo { +1| return 0 +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| return 0 + +[#2 Removal] = 1:0-2:0 + >------------ +1| return 0 +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0 + +[#2 Insertion delimiter] = "\n" diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 9498023ed51..1ba03a6b60a 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -13,6 +13,7 @@ (if_statement) (while_statement) (for_statement) + (c_style_for_statement) (function_definition) (declaration_command) (case_statement) @@ -22,21 +23,19 @@ ] @statement ( - (_ - [ - (variable_assignment) - (command) - ] @statement - (#not-parent-type? - @statement - declaration_command - c_style_for_statement - list - redirected_statement - if_statement - elif_clause - while_statement - ) + [ + (variable_assignment) + (command) + ] @statement + (#not-parent-type? + @statement + declaration_command + c_style_for_statement + list + redirected_statement + if_statement + elif_clause + while_statement ) ) @@ -45,6 +44,10 @@ (#document-range! @statement.iteration) ) +;;!! [[ $foo =~ ^\w+$ ]] +;;! ^^^^^ +(regex) @regularExpression @textFragment + ;;!! for v in values; do :; done ;;! ^ ;;! ^^^^^^ @@ -53,6 +56,12 @@ value: (_) @value ) @_.domain +;;!! for ((i = 0; i < 2; i++)); do :; done +;;! ^^^^^ +(c_style_for_statement + condition: (_) @condition +) @_.domain + ;;!! while true; do :; done ;;! ^^^^ (while_statement @@ -323,5 +332,3 @@ (declaration_command (variable_name) @name ) @_.domain - -(regex) @regularExpression @textFragment From cb40fcdb45bedb8c4b644614c3066112bbd4fae5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 14:00:48 +0200 Subject: [PATCH 09/26] Funk --- .../namedFunction.iteration.document.scope | 12 ++++++++ .../namedFunction/namedFunction.scope | 10 +++++++ .../namedFunction/namedFunction2.scope | 10 +++++++ .../namedFunction/namedFunction3.scope | 10 +++++++ .../shellscript/value/value.return.scope | 22 +++++++++++++++ .../shellscript/value/value.return2.scope | 22 +++++++++++++++ resources/queries/shellscript.scm | 28 ++++++++++++++----- 7 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/namedFunction/namedFunction.iteration.document.scope create mode 100644 resources/fixtures/scopes/shellscript/namedFunction/namedFunction.scope create mode 100644 resources/fixtures/scopes/shellscript/namedFunction/namedFunction2.scope create mode 100644 resources/fixtures/scopes/shellscript/namedFunction/namedFunction3.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.return.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.return2.scope diff --git a/resources/fixtures/scopes/shellscript/namedFunction/namedFunction.iteration.document.scope b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction.iteration.document.scope new file mode 100644 index 00000000000..9edaf417f24 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction.iteration.document.scope @@ -0,0 +1,12 @@ + +foo() {} + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo() {} +2| + < diff --git a/resources/fixtures/scopes/shellscript/namedFunction/namedFunction.scope b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction.scope new file mode 100644 index 00000000000..356c17f9495 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction.scope @@ -0,0 +1,10 @@ +foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/resources/fixtures/scopes/shellscript/namedFunction/namedFunction2.scope b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction2.scope new file mode 100644 index 00000000000..3ce77f61342 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction2.scope @@ -0,0 +1,10 @@ +function foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| function foo {} + +[Insertion delimiter] = "\n\n" diff --git a/resources/fixtures/scopes/shellscript/namedFunction/namedFunction3.scope b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction3.scope new file mode 100644 index 00000000000..bb0fb087704 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/namedFunction/namedFunction3.scope @@ -0,0 +1,10 @@ +function foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| function foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/resources/fixtures/scopes/shellscript/value/value.return.scope b/resources/fixtures/scopes/shellscript/value/value.return.scope new file mode 100644 index 00000000000..36c47c5d365 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.return.scope @@ -0,0 +1,22 @@ +foo() { + return 0; +} +--- + +[Content] = 1:11-1:12 + >-< +1| return 0; + +[Removal] = 1:10-1:12 + >--< +1| return 0; + +[Leading delimiter] = 1:10-1:11 + >-< +1| return 0; + +[Domain] = 1:4-1:12 + >--------< +1| return 0; + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.return2.scope b/resources/fixtures/scopes/shellscript/value/value.return2.scope new file mode 100644 index 00000000000..7046cf05fe0 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.return2.scope @@ -0,0 +1,22 @@ +function foo { + return 0; +} +--- + +[Content] = 1:11-1:12 + >-< +1| return 0; + +[Removal] = 1:10-1:12 + >--< +1| return 0; + +[Leading delimiter] = 1:10-1:11 + >-< +1| return 0; + +[Domain] = 1:4-1:12 + >--------< +1| return 0; + +[Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 1ba03a6b60a..0eee1bfa915 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -40,8 +40,8 @@ ) ( - (program) @statement.iteration - (#document-range! @statement.iteration) + (program) @statement.iteration @namedFunction.iteration + (#document-range! @statement.iteration @namedFunction.iteration) ) ;;!! [[ $foo =~ ^\w+$ ]] @@ -60,33 +60,47 @@ ;;! ^^^^^ (c_style_for_statement condition: (_) @condition -) @_.domain +) @condition.domain ;;!! while true; do :; done ;;! ^^^^ (while_statement condition: (_) @condition -) @_.domain +) @condition.domain ;;!! if true; then :; fi ;;! ^^^^ (if_statement condition: (_) @condition -) @_.domain +) @condition.domain ;;!! elif false; then ;;! ^^^^^ (elif_clause (_) @condition "then" -) @branch @_.domain +) @branch @condition.domain ;;!! else :; fi (else_clause) @branch +;;!! ((true ? 0 : 1)) +;;! ^^^^ (ternary_expression condition: (_) @condition -) @_.domain +) @condition.domain + +;;!! return 0 +;;! ^ +( + (command + name: (command_name + (word) @_dummy + ) + argument: (_) @value + ) @value.domain + (#eq? @_dummy return) +) ;; ;; Conditionals From 8152fe4c0d040a246f91ec4c00b205fb6b77b241 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 14:10:07 +0200 Subject: [PATCH 10/26] List and map --- resources/fixtures/scopes/shellscript/list.scope | 8 ++++---- resources/fixtures/scopes/shellscript/map.scope | 10 ++++++++++ .../shellscript/name/name.iteration.document.scope | 12 ++++++++++++ .../value/value.iteration.document.scope | 12 ++++++++++++ resources/queries/shellscript.scm | 14 ++++++++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/map.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.iteration.document.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.iteration.document.scope diff --git a/resources/fixtures/scopes/shellscript/list.scope b/resources/fixtures/scopes/shellscript/list.scope index cd12626c82e..169ac2c693d 100644 --- a/resources/fixtures/scopes/shellscript/list.scope +++ b/resources/fixtures/scopes/shellscript/list.scope @@ -1,10 +1,10 @@ -declare -a arr=("apple" "banana" "cherry") +foo=(aaa bbb) --- [Content] = [Removal] = -[Domain] = 0:15-0:42 -0| declare -a arr=("apple" "banana" "cherry") - >---------------------------< +[Domain] = 0:4-0:13 + >---------< +0| foo=(aaa bbb) [Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/map.scope b/resources/fixtures/scopes/shellscript/map.scope new file mode 100644 index 00000000000..d8d71be3f7d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/map.scope @@ -0,0 +1,10 @@ +foo=(["aaa"]=0 ["bbb"]=1) +--- + +[Content] = +[Removal] = +[Domain] = 0:4-0:25 + >---------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/name/name.iteration.document.scope b/resources/fixtures/scopes/shellscript/name/name.iteration.document.scope new file mode 100644 index 00000000000..c73f4c1df8f --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.iteration.document.scope @@ -0,0 +1,12 @@ + +declare foo + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| declare foo +2| + < diff --git a/resources/fixtures/scopes/shellscript/value/value.iteration.document.scope b/resources/fixtures/scopes/shellscript/value/value.iteration.document.scope new file mode 100644 index 00000000000..c73f4c1df8f --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.iteration.document.scope @@ -0,0 +1,12 @@ + +declare foo + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| declare foo +2| + < diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 0eee1bfa915..c935fee2524 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -43,11 +43,25 @@ (program) @statement.iteration @namedFunction.iteration (#document-range! @statement.iteration @namedFunction.iteration) ) +( + (program) @name.iteration @value.iteration + (#document-range! @name.iteration @value.iteration) +) ;;!! [[ $foo =~ ^\w+$ ]] ;;! ^^^^^ (regex) @regularExpression @textFragment +;;!! foo=(aaa bbb) +;;! ^^^^^^^^^ +(array) @list + +;;!! foo=(["aaa"]=0 ["bbb"]=1) +;;! ^^^^^^^^^^^^^^^^^^^^^ +(array + (concatenation) +) @map + ;;!! for v in values; do :; done ;;! ^ ;;! ^^^^^^ From cb6d6341b80356acc7420dfab79d0a953f3126e3 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 14:39:40 +0200 Subject: [PATCH 11/26] key value pairs --- .../branch/branch.switchCase.iteration.scope | 7 +++ .../branch/branch.ternary.iteration.scope | 7 +++ .../shellscript/branch/branch.ternary.scope | 37 ++++++++++++++ .../condition.switchCase.iteration.scope | 7 +++ .../condition/condition.switchCase.scope | 22 +++++++++ .../shellscript/key.mapPair.iteration.scope | 7 +++ .../scopes/shellscript/key.mapPair.scope | 25 ++++++++++ .../statement/statement.switch.scope | 10 ++++ .../statement/statement.update.scope | 10 ++++ .../statement.variable.initialized.scope | 10 ++++ .../statement.variable.initialized2.scope | 10 ++++ .../statement.variable.uninitialized.scope | 10 ++++ .../value/value.mapPair.iteration.scope | 13 +++++ .../shellscript/value/value.mapPair.scope | 48 +++++++++++++++++++ .../shellscript/value/value.switch.scope | 24 ++++++++++ resources/queries/shellscript.scm | 36 ++++++++++++++ 16 files changed, 283 insertions(+) create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.switchCase.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.ternary.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.ternary.scope create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.switchCase.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/condition/condition.switchCase.scope create mode 100644 resources/fixtures/scopes/shellscript/key.mapPair.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/key.mapPair.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.switch.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.update.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.variable.initialized.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.variable.initialized2.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.variable.uninitialized.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.mapPair.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.mapPair.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.switch.scope diff --git a/resources/fixtures/scopes/shellscript/branch/branch.switchCase.iteration.scope b/resources/fixtures/scopes/shellscript/branch/branch.switchCase.iteration.scope new file mode 100644 index 00000000000..7f8b71c51d3 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.switchCase.iteration.scope @@ -0,0 +1,7 @@ +case $foo in esac +--- + +[Content] = +[Domain] = 0:12-0:13 + >-< +0| case $foo in esac diff --git a/resources/fixtures/scopes/shellscript/branch/branch.ternary.iteration.scope b/resources/fixtures/scopes/shellscript/branch/branch.ternary.iteration.scope new file mode 100644 index 00000000000..37eb212d5fd --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.ternary.iteration.scope @@ -0,0 +1,7 @@ +((true ? 0 : 1)) +--- + +[Content] = +[Domain] = 0:2-0:14 + >------------< +0| ((true ? 0 : 1)) diff --git a/resources/fixtures/scopes/shellscript/branch/branch.ternary.scope b/resources/fixtures/scopes/shellscript/branch/branch.ternary.scope new file mode 100644 index 00000000000..63600b864e6 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.ternary.scope @@ -0,0 +1,37 @@ +((true ? 0 : 1)) +--- + +[#1 Content] = +[#1 Domain] = 0:9-0:10 + >-< +0| ((true ? 0 : 1)) + +[#1 Removal] = 0:9-0:11 + >--< +0| ((true ? 0 : 1)) + +[#1 Leading delimiter] = 0:8-0:9 + >-< +0| ((true ? 0 : 1)) + +[#1 Trailing delimiter] = 0:10-0:11 + >-< +0| ((true ? 0 : 1)) + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:13-0:14 + >-< +0| ((true ? 0 : 1)) + +[#2 Removal] = 0:12-0:14 + >--< +0| ((true ? 0 : 1)) + +[#2 Leading delimiter] = 0:12-0:13 + >-< +0| ((true ? 0 : 1)) + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/condition/condition.switchCase.iteration.scope b/resources/fixtures/scopes/shellscript/condition/condition.switchCase.iteration.scope new file mode 100644 index 00000000000..7f8b71c51d3 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.switchCase.iteration.scope @@ -0,0 +1,7 @@ +case $foo in esac +--- + +[Content] = +[Domain] = 0:12-0:13 + >-< +0| case $foo in esac diff --git a/resources/fixtures/scopes/shellscript/condition/condition.switchCase.scope b/resources/fixtures/scopes/shellscript/condition/condition.switchCase.scope new file mode 100644 index 00000000000..048ec49ece6 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/condition/condition.switchCase.scope @@ -0,0 +1,22 @@ +case $foo in + 0) : ;; +esac +--- + +[Content] = 1:2-1:3 + >-< +1| 0) : ;; + +[Removal] = 1:0-1:3 + >---< +1| 0) : ;; + +[Leading delimiter] = 1:0-1:2 + >--< +1| 0) : ;; + +[Domain] = 1:2-1:9 + >-------< +1| 0) : ;; + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/key.mapPair.iteration.scope b/resources/fixtures/scopes/shellscript/key.mapPair.iteration.scope new file mode 100644 index 00000000000..1ca06d9e0fe --- /dev/null +++ b/resources/fixtures/scopes/shellscript/key.mapPair.iteration.scope @@ -0,0 +1,7 @@ +foo=(["aaa"]=0 ["bbb"]=1) +--- + +[Content] = +[Domain] = 0:5-0:24 + >-------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) diff --git a/resources/fixtures/scopes/shellscript/key.mapPair.scope b/resources/fixtures/scopes/shellscript/key.mapPair.scope new file mode 100644 index 00000000000..97524f2b03d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/key.mapPair.scope @@ -0,0 +1,25 @@ +foo=(["aaa"]=0 ["bbb"]=1) +--- + +[#1 Content] = +[#1 Removal] = 0:6-0:11 + >-----< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#1 Domain] = 0:5-0:14 + >---------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:16-0:21 + >-----< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#2 Domain] = 0:15-0:24 + >---------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#2 Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/statement/statement.switch.scope b/resources/fixtures/scopes/shellscript/statement/statement.switch.scope new file mode 100644 index 00000000000..cce61292a05 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.switch.scope @@ -0,0 +1,10 @@ +case $foo in esac +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| case $foo in esac + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.update.scope b/resources/fixtures/scopes/shellscript/statement/statement.update.scope new file mode 100644 index 00000000000..f3c5053f148 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.update.scope @@ -0,0 +1,10 @@ +((foo++)) +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| ((foo++)) + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.variable.initialized.scope b/resources/fixtures/scopes/shellscript/statement/statement.variable.initialized.scope new file mode 100644 index 00000000000..b4d4b228070 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.variable.initialized.scope @@ -0,0 +1,10 @@ +local foo=0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| local foo=0 + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.variable.initialized2.scope b/resources/fixtures/scopes/shellscript/statement/statement.variable.initialized2.scope new file mode 100644 index 00000000000..dc5d3d5d746 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.variable.initialized2.scope @@ -0,0 +1,10 @@ +declare foo=0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| declare foo=0 + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/statement/statement.variable.uninitialized.scope b/resources/fixtures/scopes/shellscript/statement/statement.variable.uninitialized.scope new file mode 100644 index 00000000000..7c54acedfe3 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +declare foo +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| declare foo + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/value/value.mapPair.iteration.scope b/resources/fixtures/scopes/shellscript/value/value.mapPair.iteration.scope new file mode 100644 index 00000000000..7eaa34a8da1 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.mapPair.iteration.scope @@ -0,0 +1,13 @@ +foo=(["aaa"]=0 ["bbb"]=1) +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:25 + >-------------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) + + +[#2 Content] = +[#2 Domain] = 0:5-0:24 + >-------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) diff --git a/resources/fixtures/scopes/shellscript/value/value.mapPair.scope b/resources/fixtures/scopes/shellscript/value/value.mapPair.scope new file mode 100644 index 00000000000..511aef3cb42 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.mapPair.scope @@ -0,0 +1,48 @@ +foo=(["aaa"]=0 ["bbb"]=1) +--- + +[#1 Content] = 0:4-0:25 + >---------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#1 Removal] = 0:3-0:25 + >----------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#1 Leading delimiter] = 0:3-0:4 + >-< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#1 Domain] = 0:0-0:25 + >-------------------------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:13-0:14 + >-< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#2 Trailing delimiter] = 0:14-0:15 + >-< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#2 Domain] = 0:5-0:14 + >---------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:23-0:24 + >-< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#3 Domain] = 0:15-0:24 + >---------< +0| foo=(["aaa"]=0 ["bbb"]=1) + +[#3 Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/value/value.switch.scope b/resources/fixtures/scopes/shellscript/value/value.switch.scope new file mode 100644 index 00000000000..0de4077af9d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.switch.scope @@ -0,0 +1,24 @@ +case $foo in esac +--- + +[Content] = 0:5-0:9 + >----< +0| case $foo in esac + +[Removal] = 0:5-0:10 + >-----< +0| case $foo in esac + +[Leading delimiter] = 0:4-0:5 + >-< +0| case $foo in esac + +[Trailing delimiter] = 0:9-0:10 + >-< +0| case $foo in esac + +[Domain] = 0:0-0:17 + >-----------------< +0| case $foo in esac + +[Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index c935fee2524..caadf4d6d98 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -20,6 +20,7 @@ (subshell) (list) (redirected_statement) + (test_command) ] @statement ( @@ -58,10 +59,25 @@ ;;!! foo=(["aaa"]=0 ["bbb"]=1) ;;! ^^^^^^^^^^^^^^^^^^^^^ +;;! ^^^^^^^^^^^^^^^^^^^ (array + "(" @collectionKey.iteration.start.endOf @value.iteration.start.endOf (concatenation) + ")" @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) @map +;;!! foo=(["aaa"]=0 ["bbb"]=1) +;;! ^^^^^ ^^^^^ +;;! ^ ^ +(array + (concatenation + (string) @collectionKey + (_) @value + . + ) @_.domain + (#character-range! @value 1) +) + ;;!! for v in values; do :; done ;;! ^ ;;! ^^^^^^ @@ -102,6 +118,26 @@ ;;! ^^^^ (ternary_expression condition: (_) @condition + consequence: (_) @branch +) @condition.domain @branch.iteration + +(ternary_expression + alternative: (_) @branch +) + +;;!! case $foo in esac +;;! ^^^^ +;;! ^ +(case_statement + value: (_) @value + "in" @branch.iteration.start.endOf @condition.iteration.start.endOf + "esac" @branch.iteration.end.startOf @condition.iteration.end.startOf +) @value.domain + +;;!! 0) : ;; +;;! ^ +(case_item + value: (_) @condition ) @condition.domain ;;!! return 0 From 737355d9505c72fced974ec37930d4025a944c19 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 14:43:16 +0200 Subject: [PATCH 12/26] Move playground file --- .../shellscript => resources/playground}/shellscript.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {data/playground/shellscript => resources/playground}/shellscript.sh (100%) mode change 100755 => 100644 diff --git a/data/playground/shellscript/shellscript.sh b/resources/playground/shellscript.sh old mode 100755 new mode 100644 similarity index 100% rename from data/playground/shellscript/shellscript.sh rename to resources/playground/shellscript.sh From 3868978b1bb49f6749f315644644b36bd5276ee8 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 14:45:38 +0200 Subject: [PATCH 13/26] clean up --- .../src/scopeSupportFacets/shellscript.ts | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/lib-common/src/scopeSupportFacets/shellscript.ts b/packages/lib-common/src/scopeSupportFacets/shellscript.ts index 40978dd2567..aaf9f3f473e 100644 --- a/packages/lib-common/src/scopeSupportFacets/shellscript.ts +++ b/packages/lib-common/src/scopeSupportFacets/shellscript.ts @@ -7,6 +7,12 @@ const { supported, notApplicable } = ScopeSupportFacetLevel; export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { list: supported, + regularExpression: supported, + map: supported, + ifStatement: supported, + functionCall: supported, + functionCallee: supported, + "comment.line": supported, "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, @@ -21,8 +27,6 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary": supported, "branch.ternary.iteration": supported, - "comment.line": supported, - "condition.if": supported, "condition.while": supported, "condition.for": supported, @@ -30,15 +34,9 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "condition.switchCase.iteration": supported, "condition.ternary": supported, - functionCall: supported, - - functionCallee: supported, - namedFunction: supported, "namedFunction.iteration.document": supported, - ifStatement: supported, - "statement.function": supported, "statement.functionCall": supported, "statement.if": supported, @@ -100,16 +98,10 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "key.mapPair": supported, "key.mapPair.iteration": supported, - regularExpression: supported, - - disqualifyDelimiter: supported, - "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, "argumentList.actual.multiLine": supported, - map: supported, - /* NOT APPLICABLE */ // Classes, interfaces, methods, and constructors @@ -368,6 +360,7 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { // Markup environments, selectors, units, and custom delimiter pairs pairDelimiter: notApplicable, + disqualifyDelimiter: notApplicable, environment: notApplicable, selector: notApplicable, unit: notApplicable, From 2791cb52e81952c0d156ab8b29b6fa26db081cb5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 15:25:56 +0200 Subject: [PATCH 14/26] argument list --- .../src/scopeSupportFacets/shellscript.ts | 2 +- .../argumentList.actual.empty.scope | 13 +++++++ .../argumentList.actual.multiLine.scope | 27 +++++++++++++ .../argumentList.actual.singleLine.scope | 20 ++++++++++ resources/queries/shellscript.scm | 39 ++++++++++++------- 5 files changed, 86 insertions(+), 15 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/argumentList.actual.empty.scope create mode 100644 resources/fixtures/scopes/shellscript/argumentList.actual.multiLine.scope create mode 100644 resources/fixtures/scopes/shellscript/argumentList.actual.singleLine.scope diff --git a/packages/lib-common/src/scopeSupportFacets/shellscript.ts b/packages/lib-common/src/scopeSupportFacets/shellscript.ts index aaf9f3f473e..1c60bbec90d 100644 --- a/packages/lib-common/src/scopeSupportFacets/shellscript.ts +++ b/packages/lib-common/src/scopeSupportFacets/shellscript.ts @@ -53,7 +53,6 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "statement.break": supported, "statement.continue": supported, "statement.import": supported, - "statement.misc": supported, "statement.update": supported, "statement.iteration.document": supported, "statement.iteration.block": supported, @@ -359,6 +358,7 @@ export const shellscriptScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": notApplicable, // Markup environments, selectors, units, and custom delimiter pairs + "statement.misc": notApplicable, pairDelimiter: notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, diff --git a/resources/fixtures/scopes/shellscript/argumentList.actual.empty.scope b/resources/fixtures/scopes/shellscript/argumentList.actual.empty.scope new file mode 100644 index 00000000000..ef25b7bec23 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/argumentList.actual.empty.scope @@ -0,0 +1,13 @@ +foo +--- + +[Content] = +[Removal] = 0:3-0:3 + >< +0| foo + +[Domain] = 0:0-0:3 + >---< +0| foo + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/argumentList.actual.multiLine.scope b/resources/fixtures/scopes/shellscript/argumentList.actual.multiLine.scope new file mode 100644 index 00000000000..26cf997579a --- /dev/null +++ b/resources/fixtures/scopes/shellscript/argumentList.actual.multiLine.scope @@ -0,0 +1,27 @@ +foo aaa \ + bbb +--- + +[Content] = 0:4-1:5 + >----- +0| foo aaa \ +1| bbb + -----< + +[Removal] = 0:3-1:5 + >------ +0| foo aaa \ +1| bbb + -----< + +[Leading delimiter] = 0:3-0:4 + >-< +0| foo aaa \ + +[Domain] = 0:0-1:5 + >--------- +0| foo aaa \ +1| bbb + -----< + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/argumentList.actual.singleLine.scope b/resources/fixtures/scopes/shellscript/argumentList.actual.singleLine.scope new file mode 100644 index 00000000000..83e8347e777 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/argumentList.actual.singleLine.scope @@ -0,0 +1,20 @@ +foo aaa bbb +--- + +[Content] = 0:4-0:11 + >-------< +0| foo aaa bbb + +[Removal] = 0:3-0:11 + >--------< +0| foo aaa bbb + +[Leading delimiter] = 0:3-0:4 + >-< +0| foo aaa bbb + +[Domain] = 0:0-0:11 + >-----------< +0| foo aaa bbb + +[Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index caadf4d6d98..22e93f95241 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -309,22 +309,33 @@ ;; Functions ;; -;;!! echo "foo" -;;! ^^^^^ -(_ - argument: (_) @argumentOrParameter -) @_.iteration - -;; call: -;;!! echo "foo" -;;! ^^^^^^^^^^ -;; callee: -;;!! echo "foo" -;;! ^^^^ -;;! ---------- +;;!! foo aaa bbb +;;! ^^^^^^^^^^^ +;;! ^^^ (command name: (_) @functionCallee -) @_.domain @functionCall @command +) @functionCallee.domain @functionCall + +;;!! foo aaa bbb +;;! ^^^^^^^ +(command + name: (_) + . + argument: (_) @argumentList.start + argument: (_)? @argumentList.end + . +) @argumentList.domain + +;;!! foo +;;! >< +(command + name: (_) @argumentList.start.endOf + !argument +) @argumentList.domain + +;; (command +;; argument: (_) @argumentOrParameter +;; ) ;;!! function foo() { ;;! ^^^ From 76d83a69d6cdbd5a41ae572b0544ae6761282034 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 15:37:50 +0200 Subject: [PATCH 15/26] arguments --- .../argument/argument.actual.iteration.scope | 10 +++++ .../argument/argument.actual.multiLine.scope | 42 +++++++++++++++++++ .../argument/argument.actual.singleLine.scope | 33 +++++++++++++++ resources/queries/shellscript.scm | 38 +++++++---------- 4 files changed, 101 insertions(+), 22 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/argument/argument.actual.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/argument/argument.actual.multiLine.scope create mode 100644 resources/fixtures/scopes/shellscript/argument/argument.actual.singleLine.scope diff --git a/resources/fixtures/scopes/shellscript/argument/argument.actual.iteration.scope b/resources/fixtures/scopes/shellscript/argument/argument.actual.iteration.scope new file mode 100644 index 00000000000..6635834b724 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/argument/argument.actual.iteration.scope @@ -0,0 +1,10 @@ +foo aaa bbb +--- + +[Content] = 0:4-0:11 + >-------< +0| foo aaa bbb + +[Domain] = 0:0-0:11 + >-----------< +0| foo aaa bbb diff --git a/resources/fixtures/scopes/shellscript/argument/argument.actual.multiLine.scope b/resources/fixtures/scopes/shellscript/argument/argument.actual.multiLine.scope new file mode 100644 index 00000000000..ff77b080515 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/argument/argument.actual.multiLine.scope @@ -0,0 +1,42 @@ +foo aaa \ + bbb +--- + +[#1 Content] = +[#1 Domain] = 0:4-0:7 + >---< +0| foo aaa \ + +[#1 Removal] = 0:4-1:2 + >----- +0| foo aaa \ +1| bbb + --< + +[#1 Trailing delimiter] = 0:7-1:2 + >-- +0| foo aaa \ +1| bbb + --< + +[#1 Insertion delimiter] = " \\\n" + + +[#2 Content] = +[#2 Domain] = 1:2-1:5 + >---< +1| bbb + +[#2 Removal] = 0:7-1:5 + >-- +0| foo aaa \ +1| bbb + -----< + +[#2 Leading delimiter] = 0:7-1:2 + >-- +0| foo aaa \ +1| bbb + --< + +[#2 Insertion delimiter] = " \\\n" diff --git a/resources/fixtures/scopes/shellscript/argument/argument.actual.singleLine.scope b/resources/fixtures/scopes/shellscript/argument/argument.actual.singleLine.scope new file mode 100644 index 00000000000..9ad2666f836 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/argument/argument.actual.singleLine.scope @@ -0,0 +1,33 @@ +foo aaa bbb +--- + +[#1 Content] = +[#1 Domain] = 0:4-0:7 + >---< +0| foo aaa bbb + +[#1 Removal] = 0:4-0:8 + >----< +0| foo aaa bbb + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| foo aaa bbb + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Domain] = 0:8-0:11 + >---< +0| foo aaa bbb + +[#2 Removal] = 0:7-0:11 + >----< +0| foo aaa bbb + +[#2 Leading delimiter] = 0:7-0:8 + >-< +0| foo aaa bbb + +[#2 Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 22e93f95241..a2656332b4a 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -289,22 +289,6 @@ . ) @string -;;!! var="foo ${bar}" -;;! ^^^^^^ -;;! xxxxxx -(string - ( - (expansion) @argumentOrParameter - ;; FIXME: This is due to a tree-sitter-bash bug (imo) where given: "Foo ${BAR} ${BAZ}" - ;; ${BAZ} incorrectly includes preceding space - (#shrink-to-match! @argumentOrParameter "\\s*(?.*)") - ) -) -(string - (simple_expansion) @argumentOrParameter - (#shrink-to-match! @argumentOrParameter "\\s*(?.*)") -) - ;; ;; Functions ;; @@ -321,10 +305,10 @@ (command name: (_) . - argument: (_) @argumentList.start - argument: (_)? @argumentList.end + argument: (_) @argumentList.start @argumentOrParameter.iteration.start + argument: (_)? @argumentList.end @argumentOrParameter.iteration.end . -) @argumentList.domain +) @argumentList.domain @argumentOrParameter.iteration.domain ;;!! foo ;;! >< @@ -333,9 +317,19 @@ !argument ) @argumentList.domain -;; (command -;; argument: (_) @argumentOrParameter -;; ) +;;!! foo aaa bbb +;;! ^^^ ^^^ +(_ + (command + name: (_) + argument: (_)? @_.leading.endOf + . + argument: (_) @argumentOrParameter + . + argument: (_)? @_.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy " " " \\\n") +) ;;!! function foo() { ;;! ^^^ From c952ab5e32195343a5fd2bd9b7c5800f26fa8121 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 16:59:09 +0200 Subject: [PATCH 16/26] branch --- .../queryPredicateOperators.ts | 20 +- .../branch/branch.if.elif.else.scope | 58 ++++++ .../shellscript/branch/branch.if.else.scope | 39 ++++ .../branch/branch.if.iteration.scope | 14 ++ .../scopes/shellscript/branch/branch.if.scope | 10 + .../branch/branch.switchCase.scope | 21 ++ .../branch/branch.switchCase2.scope | 21 ++ resources/queries/shellscript.scm | 184 ++++-------------- 8 files changed, 221 insertions(+), 146 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.if.elif.else.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.if.else.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.if.iteration.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.if.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.switchCase.scope create mode 100644 resources/fixtures/scopes/shellscript/branch/branch.switchCase2.scope diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts b/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts index 796fcfce009..21d396057b5 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts @@ -92,6 +92,23 @@ class NotParentType extends QueryPredicateOperator { } } +/** + * A predicate operator that returns true if none of the node's direct children + * have any of the given types. For example, `(#not-child-type? @foo else_clause + * elif_clause)` rejects an if statement with an else or elif clause. Named and + * anonymous children are checked; descendants below the direct children are not + * checked. + */ +class NotChildType extends QueryPredicateOperator { + name = "not-child-type?" as const; + schema = z.tuple([q.node, q.string]).rest(q.string); + run(capture: MutableQueryCapture, ...types: string[]) { + return !getNode(capture).children.some((child) => + types.includes(child.type), + ); + } +} + /** * A predicate operator that returns true if the node is the nth child of its * parent. For example, `(#is-nth-child? @foo 0)` will reject the match if the @@ -211,7 +228,7 @@ class ShrinkToMatch extends QueryPredicateOperator { const match = text.match(new RegExp(pattern, "dsu")); if (match?.index == null) { - throw new Error(`No match for pattern '${pattern}'`); + throw new Error(`No match for pattern '${pattern}' on text '${text}'`); } const offsets = match.indices?.groups?.keep ?? match.indices?.[0]; @@ -462,6 +479,7 @@ export const queryPredicateOperators = [ new TrimEnd(), new DocumentRange(), new NotParentType(), + new NotChildType(), new IsNthChild(), new ChildRange(), new CharacterRange(), diff --git a/resources/fixtures/scopes/shellscript/branch/branch.if.elif.else.scope b/resources/fixtures/scopes/shellscript/branch/branch.if.elif.else.scope new file mode 100644 index 00000000000..bac97e09b03 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.if.elif.else.scope @@ -0,0 +1,58 @@ +if true; then + : +elif false; then + : +else + : +fi +--- + +[#1 Content] = +[#1 Domain] = 0:0-1:5 + >------------- +0| if true; then +1| : + -----< + +[#1 Removal] = 0:0-2:2 + >------------- +0| if true; then +1| : +2| elif false; then + --< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:0-3:5 + >---------------- +2| elif false; then +3| : + -----< + +[#2 Removal] = 2:0-4:0 + >---------------- +2| elif false; then +3| : +4| else + < + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 4:0-5:5 + >---- +4| else +5| : + -----< + +[#3 Removal] = 4:0-6:0 + >---- +4| else +5| : +6| fi + < + +[#3 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/branch/branch.if.else.scope b/resources/fixtures/scopes/shellscript/branch/branch.if.else.scope new file mode 100644 index 00000000000..d7193d35ef4 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.if.else.scope @@ -0,0 +1,39 @@ +if true; then + : +else + : +fi +--- + +[#1 Content] = +[#1 Domain] = 0:0-1:5 + >------------- +0| if true; then +1| : + -----< + +[#1 Removal] = 0:0-2:0 + >------------- +0| if true; then +1| : +2| else + < + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:0-3:5 + >---- +2| else +3| : + -----< + +[#2 Removal] = 2:0-4:0 + >---- +2| else +3| : +4| fi + < + +[#2 Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/branch/branch.if.iteration.scope b/resources/fixtures/scopes/shellscript/branch/branch.if.iteration.scope new file mode 100644 index 00000000000..71a97625dbc --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.if.iteration.scope @@ -0,0 +1,14 @@ +if true; then +elif false; then +else +fi +--- + +[Content] = +[Domain] = 0:0-3:2 + >------------- +0| if true; then +1| elif false; then +2| else +3| fi + --< diff --git a/resources/fixtures/scopes/shellscript/branch/branch.if.scope b/resources/fixtures/scopes/shellscript/branch/branch.if.scope new file mode 100644 index 00000000000..cfcf7c1bd4d --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.if.scope @@ -0,0 +1,10 @@ +if true; then :; fi +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| if true; then :; fi + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/branch/branch.switchCase.scope b/resources/fixtures/scopes/shellscript/branch/branch.switchCase.scope new file mode 100644 index 00000000000..24f39ca8028 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.switchCase.scope @@ -0,0 +1,21 @@ +case $foo in + 0) : ;; +esac +--- + +[Content] = +[Domain] = 1:4-1:11 + >-------< +1| 0) : ;; + +[Removal] = 1:0-2:0 + >----------- +1| 0) : ;; +2| esac + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| 0) : ;; + +[Insertion delimiter] = "\n" diff --git a/resources/fixtures/scopes/shellscript/branch/branch.switchCase2.scope b/resources/fixtures/scopes/shellscript/branch/branch.switchCase2.scope new file mode 100644 index 00000000000..b8015b152ab --- /dev/null +++ b/resources/fixtures/scopes/shellscript/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +case $foo in + *) : ;; +esac +--- + +[Content] = +[Domain] = 1:4-1:11 + >-------< +1| *) : ;; + +[Removal] = 1:0-2:0 + >----------- +1| *) : ;; +2| esac + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| *) : ;; + +[Insertion delimiter] = "\n" diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index a2656332b4a..865237e2285 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -1,14 +1,3 @@ -;; -;; Statements -;; - -;; ( -;; (program -;; (_) @statement -;; ) -;; (#not-type? @statement comment) -;; ) - [ (if_statement) (while_statement) @@ -98,21 +87,54 @@ condition: (_) @condition ) @condition.domain +;;!! if true; then :; fi +(if_statement) @ifStatement @branch.iteration @condition.iteration + ;;!! if true; then :; fi ;;! ^^^^ (if_statement condition: (_) @condition ) @condition.domain +;;!! if true; then :; fi +( + (if_statement) @branch + (#not-child-type? @branch elif_clause else_clause) +) + +;;!! if true; then :; else :; fi +( + (if_statement + "if" @branch.start @branch.removal.start + "then" + (_) @branch.end @branch.removal.end + . + [ + (elif_clause) + (else_clause) + ] @branch.removal.end.startOf + ) + (#not-type? @branch.end elif_clause else_clause) + (#shrink-to-match! @branch.removal.end.startOf "^(?:el(?=if\\b))?(?.*)") +) + ;;!! elif false; then ;;! ^^^^^ -(elif_clause - (_) @condition - "then" -) @branch @condition.domain +( + (elif_clause + (_) @condition + "then" + ) @branch @branch.removal.start @condition.domain + _ @branch.removal.end.startOf + (#trim-end! @branch) +) ;;!! else :; fi -(else_clause) @branch +( + (else_clause) @branch @branch.removal.start + "fi" @branch.removal.end.startOf + (#trim-end! @branch) +) ;;!! ((true ? 0 : 1)) ;;! ^^^^ @@ -138,7 +160,7 @@ ;;! ^ (case_item value: (_) @condition -) @condition.domain +) @branch @condition.domain ;;!! return 0 ;;! ^ @@ -152,130 +174,6 @@ (#eq? @_dummy return) ) -;; -;; Conditionals -;; - -(if_statement) @ifStatement @branch.iteration @condition.iteration - -;;!! if [ $value -le 0 ]; then -;;!! echo foo -;;!! fi -;; ( -;; (if_statement -;; "if" @condition.domain.start.startOf @branch.start.startOf -;; (_) @condition -;; "then" @interior.start.endOf -;; (_) @_dummy -;; . -;; "fi" @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf -;; ) -;; (#not-type? @_dummy else_clause elif_clause) -;; ) - -;;!! if [ $value -le 0 ]; then -;;!! echo foo -;;!! elif [ $value -le 0 ]; then -;;!! fi -;; ( -;; (if_statement -;; "if" @condition.domain.start.startOf @branch.start.startOf -;; (_) @condition -;; "then" @interior.start.endOf -;; (_) -;; (elif_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf -;; ) -;; ) - -;;!! if [ $value -le 0 ]; then -;;!! echo foo -;;!! else [ $value -le 0 ]; then -;;!! fi -;; ( -;; (if_statement -;; "if" @condition.domain.start.startOf @branch.start.startOf -;; (_) @condition -;; "then" @interior.start.endOf -;; (_) @_dummy -;; . -;; (else_clause) @condition.domain.end.startOf @branch.end.startOf @interior.end.startOf -;; ) -;; (#not-type? @_dummy elif_clause) -;; ) - -;;!! elif [ $value -le 0 ]; then -;;!! else -;; (elif_clause -;; (_) @condition -;; "then" -;; . -;; ) @branch @_.domain - -;;!! elif [ $value -le 0 ]; then -;;!! echo "foo1" -;;!! echo "foo1" -;; (elif_clause -;; (_) @condition -;; "then" @interior.start.endOf -;; (_) -;; ) @branch @_.domain @interior.end.endOf - -;;!! else -;;!! echo "foo1" -;;!! echo "foo1" -;;!! fi -;; (else_clause -;; "else" @interior.start.endOf -;; (_) -;; ) @branch @interior.end.endOf - -;; (_ -;; condition: (_) @condition -;; ) - -;; (case_statement) @branch.iteration @condition.iteration -;; (case_item -;; value: (_) @condition -;; . -;; ")" @interior.start.endOf -;; (_) @interior.end.endOf -;; . -;; ";;" -;; ) @branch @_.domain - -;; Lists and maps -;; - -;;!! array=("a" "b" "c") -;;! ^^^^^^^^^^^^^ -;;! ------------- -;; (array -;; "(" @interior.start.endOf -;; (_)? @collectionItem -;; ")" @interior.end.startOf -;; ) @list @collectionItem.iteration - -;;!! FIXME: I will file an issue in tree-sitter-bash as I think the grammar is -;;!! bad. But the below does work for now -;;!! arr+=(["key2"]=val2 ["key3"]=val3) -;; (array -;; ( -;; (concatenation -;; ;; This matches the [ which is (word) for some reason -;; (_) @collectionKey.leading.startOf -;; (_) @collectionKey -;; ;; This matches the ] which is also (word) for some reason -;; (_) @collectionKey.trailing.endOf -;; (_) @value -;; ) @collectionItem -;; (#shrink-to-match! @value "\=(?.*)") -;; ) -;; ) - -;; -;; Strings -;; - ;;!! # foo ;;! ^^^^^ (comment) @comment @textFragment @@ -289,10 +187,6 @@ . ) @string -;; -;; Functions -;; - ;;!! foo aaa bbb ;;! ^^^^^^^^^^^ ;;! ^^^ From 89d29f6816d4ec4e72560bf49a7c1009ba8ae753 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 17:19:46 +0200 Subject: [PATCH 17/26] interior --- .../shellscript/interior/interior.for.scope | 13 ++++++++ .../interior/interior.foreach.scope | 13 ++++++++ .../interior/interior.function.scope | 10 +++++++ .../interior/interior.function2.scope | 10 +++++++ .../interior/interior.switch.scope | 10 +++++++ .../interior/interior.switchCase.scope | 30 +++++++++++++++++++ .../shellscript/interior/interior.while.scope | 13 ++++++++ .../interior/interior.while2.scope | 13 ++++++++ resources/queries/shellscript.scm | 20 +++++++++++-- 9 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.for.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.foreach.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.function.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.function2.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.switch.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.switchCase.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.while.scope create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.while2.scope diff --git a/resources/fixtures/scopes/shellscript/interior/interior.for.scope b/resources/fixtures/scopes/shellscript/interior/interior.for.scope new file mode 100644 index 00000000000..80856e63483 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.for.scope @@ -0,0 +1,13 @@ +for ((foo = 0; foo < 2; foo++)); do :; done +--- + +[Content] = 0:36-0:38 + >--< +0| for ((foo = 0; foo < 2; foo++)); do :; done + +[Removal] = +[Domain] = 0:35-0:39 + >----< +0| for ((foo = 0; foo < 2; foo++)); do :; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.foreach.scope b/resources/fixtures/scopes/shellscript/interior/interior.foreach.scope new file mode 100644 index 00000000000..7eed3cdcca9 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.foreach.scope @@ -0,0 +1,13 @@ +for v in values; do :; done +--- + +[Content] = 0:20-0:22 + >--< +0| for v in values; do :; done + +[Removal] = +[Domain] = 0:19-0:23 + >----< +0| for v in values; do :; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.function.scope b/resources/fixtures/scopes/shellscript/interior/interior.function.scope new file mode 100644 index 00000000000..2c1e9c958c1 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.function.scope @@ -0,0 +1,10 @@ +foo() { } +--- + +[Content] = +[Removal] = +[Domain] = 0:7-0:8 + >-< +0| foo() { } + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.function2.scope b/resources/fixtures/scopes/shellscript/interior/interior.function2.scope new file mode 100644 index 00000000000..31d9a921b62 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.function2.scope @@ -0,0 +1,10 @@ +function foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:14-0:15 + >-< +0| function foo { } + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.switch.scope b/resources/fixtures/scopes/shellscript/interior/interior.switch.scope new file mode 100644 index 00000000000..0f6d8c02a20 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.switch.scope @@ -0,0 +1,10 @@ +case $foo in esac +--- + +[Content] = +[Removal] = +[Domain] = 0:12-0:13 + >-< +0| case $foo in esac + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.switchCase.scope b/resources/fixtures/scopes/shellscript/interior/interior.switchCase.scope new file mode 100644 index 00000000000..457d561e3bd --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.switchCase.scope @@ -0,0 +1,30 @@ +case $foo in + 0) : ;; +esac +--- + +[#1 Content] = 1:2-1:9 + >-------< +1| 0) : ;; + +[#1 Removal] = +[#1 Domain] = 0:12-2:0 + > +0| case $foo in +1| 0) : ;; +2| esac + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:5-1:6 + >-< +1| 0) : ;; + +[#2 Removal] = +[#2 Domain] = 1:4-1:7 + >---< +1| 0) : ;; + +[#2 Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.while.scope b/resources/fixtures/scopes/shellscript/interior/interior.while.scope new file mode 100644 index 00000000000..a5b3df39af7 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.while.scope @@ -0,0 +1,13 @@ +while foo; do :; done +--- + +[Content] = 0:14-0:16 + >--< +0| while foo; do :; done + +[Removal] = +[Domain] = 0:13-0:17 + >----< +0| while foo; do :; done + +[Insertion delimiter] = " " diff --git a/resources/fixtures/scopes/shellscript/interior/interior.while2.scope b/resources/fixtures/scopes/shellscript/interior/interior.while2.scope new file mode 100644 index 00000000000..63ab18bc2ed --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.while2.scope @@ -0,0 +1,13 @@ +until foo; do :; done +--- + +[Content] = 0:14-0:16 + >--< +0| until foo; do :; done + +[Removal] = +[Domain] = 0:13-0:17 + >----< +0| until foo; do :; done + +[Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 865237e2285..9dcb3df5c7b 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -152,14 +152,16 @@ ;;! ^ (case_statement value: (_) @value - "in" @branch.iteration.start.endOf @condition.iteration.start.endOf - "esac" @branch.iteration.end.startOf @condition.iteration.end.startOf + "in" @interior.start.endOf @branch.iteration.start.endOf @condition.iteration.start.endOf + "esac" @interior.end.startOf @branch.iteration.end.startOf @condition.iteration.end.startOf ) @value.domain ;;!! 0) : ;; ;;! ^ (case_item value: (_) @condition + ")" @interior.start.endOf + ";;" @interior.end.startOf ) @branch @condition.domain ;;!! return 0 @@ -174,6 +176,20 @@ (#eq? @_dummy return) ) +;;!! do :; done +;;! ^^^^ +(do_group + "do" @interior.start.endOf + "done" @interior.end.startOf +) + +;;!! foo() { } +;;! ^ +(compound_statement + "{" @interior.start.endOf + "}" @interior.end.startOf +) + ;;!! # foo ;;! ^^^^^ (comment) @comment @textFragment From ce21798dc7dba2278a823eb411e6d32f885ceb30 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 17:31:07 +0200 Subject: [PATCH 18/26] if interior --- .../shellscript/interior/interior.if.scope | 52 +++++++++++++++++++ resources/queries/shellscript.scm | 20 ++++--- 2 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 resources/fixtures/scopes/shellscript/interior/interior.if.scope diff --git a/resources/fixtures/scopes/shellscript/interior/interior.if.scope b/resources/fixtures/scopes/shellscript/interior/interior.if.scope new file mode 100644 index 00000000000..3855751553e --- /dev/null +++ b/resources/fixtures/scopes/shellscript/interior/interior.if.scope @@ -0,0 +1,52 @@ +if true; then + : +elif false; then + : +else + : +fi +--- + +[#1 Content] = 1:2-1:3 + >-< +1| : + +[#1 Removal] = +[#1 Domain] = 0:13-2:0 + > +0| if true; then +1| : +2| elif false; then + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 3:2-3:3 + >-< +3| : + +[#2 Removal] = +[#2 Domain] = 2:16-4:0 + > +2| elif false; then +3| : +4| else + < + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 5:2-5:3 + >-< +5| : + +[#3 Removal] = +[#3 Domain] = 4:4-6:0 + > +4| else +5| : +6| fi + < + +[#3 Insertion delimiter] = " " diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 9dcb3df5c7b..96b164d2089 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -98,7 +98,10 @@ ;;!! if true; then :; fi ( - (if_statement) @branch + (if_statement + "then" @interior.start.endOf + "fi" @interior.end.startOf + ) @branch (#not-child-type? @branch elif_clause else_clause) ) @@ -106,13 +109,13 @@ ( (if_statement "if" @branch.start @branch.removal.start - "then" + "then" @interior.start.endOf (_) @branch.end @branch.removal.end . [ (elif_clause) (else_clause) - ] @branch.removal.end.startOf + ] @branch.removal.end.startOf @interior.end.startOf ) (#not-type? @branch.end elif_clause else_clause) (#shrink-to-match! @branch.removal.end.startOf "^(?:el(?=if\\b))?(?.*)") @@ -123,16 +126,19 @@ ( (elif_clause (_) @condition - "then" + "then" @interior.start.endOf ) @branch @branch.removal.start @condition.domain - _ @branch.removal.end.startOf + . + _ @branch.removal.end.startOf @interior.end.startOf (#trim-end! @branch) ) ;;!! else :; fi ( - (else_clause) @branch @branch.removal.start - "fi" @branch.removal.end.startOf + (else_clause + "else" @interior.start.endOf + ) @branch @branch.removal.start + "fi" @branch.removal.end.startOf @interior.end.startOf (#trim-end! @branch) ) From 99870965b8d4933a2ef5fad99209b7fab834aa62 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 17:39:42 +0200 Subject: [PATCH 19/26] iteration --- .../shellscript/name/name.iteration.block.scope | 13 +++++++++++++ .../shellscript/name/name.iteration.block3.scope | 13 +++++++++++++ .../statement/statement.iteration.block.scope | 13 +++++++++++++ .../statement/statement.iteration.block3.scope | 13 +++++++++++++ .../shellscript/value/value.iteration.block.scope | 13 +++++++++++++ .../value/value.iteration.block3.scope | 13 +++++++++++++ resources/queries/shellscript.scm | 15 +++++++++++++++ 7 files changed, 93 insertions(+) create mode 100644 resources/fixtures/scopes/shellscript/name/name.iteration.block.scope create mode 100644 resources/fixtures/scopes/shellscript/name/name.iteration.block3.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.iteration.block.scope create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.iteration.block3.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.iteration.block.scope create mode 100644 resources/fixtures/scopes/shellscript/value/value.iteration.block3.scope diff --git a/resources/fixtures/scopes/shellscript/name/name.iteration.block.scope b/resources/fixtures/scopes/shellscript/name/name.iteration.block.scope new file mode 100644 index 00000000000..c034392b826 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.iteration.block.scope @@ -0,0 +1,13 @@ +foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:9 + >---------< +0| foo() { } + + +[#2 Content] = +[#2 Domain] = 0:7-0:8 + >-< +0| foo() { } diff --git a/resources/fixtures/scopes/shellscript/name/name.iteration.block3.scope b/resources/fixtures/scopes/shellscript/name/name.iteration.block3.scope new file mode 100644 index 00000000000..61135ad7e7a --- /dev/null +++ b/resources/fixtures/scopes/shellscript/name/name.iteration.block3.scope @@ -0,0 +1,13 @@ +while true; do :; done +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| while true; do :; done + + +[#2 Content] = +[#2 Domain] = 0:14-0:18 + >----< +0| while true; do :; done diff --git a/resources/fixtures/scopes/shellscript/statement/statement.iteration.block.scope b/resources/fixtures/scopes/shellscript/statement/statement.iteration.block.scope new file mode 100644 index 00000000000..c034392b826 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.iteration.block.scope @@ -0,0 +1,13 @@ +foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:9 + >---------< +0| foo() { } + + +[#2 Content] = +[#2 Domain] = 0:7-0:8 + >-< +0| foo() { } diff --git a/resources/fixtures/scopes/shellscript/statement/statement.iteration.block3.scope b/resources/fixtures/scopes/shellscript/statement/statement.iteration.block3.scope new file mode 100644 index 00000000000..61135ad7e7a --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.iteration.block3.scope @@ -0,0 +1,13 @@ +while true; do :; done +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| while true; do :; done + + +[#2 Content] = +[#2 Domain] = 0:14-0:18 + >----< +0| while true; do :; done diff --git a/resources/fixtures/scopes/shellscript/value/value.iteration.block.scope b/resources/fixtures/scopes/shellscript/value/value.iteration.block.scope new file mode 100644 index 00000000000..c034392b826 --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.iteration.block.scope @@ -0,0 +1,13 @@ +foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:9 + >---------< +0| foo() { } + + +[#2 Content] = +[#2 Domain] = 0:7-0:8 + >-< +0| foo() { } diff --git a/resources/fixtures/scopes/shellscript/value/value.iteration.block3.scope b/resources/fixtures/scopes/shellscript/value/value.iteration.block3.scope new file mode 100644 index 00000000000..61135ad7e7a --- /dev/null +++ b/resources/fixtures/scopes/shellscript/value/value.iteration.block3.scope @@ -0,0 +1,13 @@ +while true; do :; done +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| while true; do :; done + + +[#2 Content] = +[#2 Domain] = 0:14-0:18 + >----< +0| while true; do :; done diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 96b164d2089..03e7d7465bb 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -170,6 +170,11 @@ ";;" @interior.end.startOf ) @branch @condition.domain +(case_item + ")" @statement.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf + ";;" @statement.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf +) + ;;!! return 0 ;;! ^ ( @@ -189,6 +194,11 @@ "done" @interior.end.startOf ) +(do_group + "do" @statement.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf + "done" @statement.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf +) + ;;!! foo() { } ;;! ^ (compound_statement @@ -196,6 +206,11 @@ "}" @interior.end.startOf ) +(compound_statement + "{" @statement.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf + "}" @statement.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf +) + ;;!! # foo ;;! ^^^^^ (comment) @comment @textFragment From 3cd12b56644f785c8eb0030820844b74921f93c4 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 17:46:44 +0200 Subject: [PATCH 20/26] Fix lint problems --- .../private-scopes/fixtures/interior.json | 180 ++ .../private-scopes/fixtures/string.json | 34 + .../private-scopes/fixtures/textFragment.json | 51 + .../contributing/private-scopes/interior.mdx | 32 + .../contributing/private-scopes/string.mdx | 8 + .../private-scopes/textFragment.mdx | 12 + .../src/docs/user/languages/README.md | 1 + .../user/languages/fixtures/shellscript.json | 2029 +++++++++++++++++ .../src/docs/user/languages/shellscript.mdx | 596 +++++ .../src/docs/user/scopes/argumentList.mdx | 12 + .../docs/user/scopes/argumentOrParameter.mdx | 12 + .../src/docs/user/scopes/branch.mdx | 34 + .../src/docs/user/scopes/collectionKey.mdx | 8 + .../src/docs/user/scopes/comment.mdx | 4 + .../src/docs/user/scopes/condition.mdx | 26 + .../user/scopes/fixtures/argumentList.json | 51 + .../scopes/fixtures/argumentOrParameter.json | 68 + .../src/docs/user/scopes/fixtures/branch.json | 186 ++ .../user/scopes/fixtures/collectionKey.json | 42 + .../docs/user/scopes/fixtures/comment.json | 17 + .../docs/user/scopes/fixtures/condition.json | 127 ++ .../user/scopes/fixtures/functionCall.json | 34 + .../user/scopes/fixtures/functionCallee.json | 34 + .../user/scopes/fixtures/ifStatement.json | 17 + .../src/docs/user/scopes/fixtures/list.json | 17 + .../src/docs/user/scopes/fixtures/map.json | 17 + .../src/docs/user/scopes/fixtures/name.json | 250 ++ .../user/scopes/fixtures/namedFunction.json | 67 + .../scopes/fixtures/regularExpression.json | 17 + .../docs/user/scopes/fixtures/statement.json | 526 +++++ .../src/docs/user/scopes/fixtures/value.json | 292 +++ .../src/docs/user/scopes/functionCall.mdx | 6 + .../src/docs/user/scopes/functionCallee.mdx | 6 + .../src/docs/user/scopes/ifStatement.mdx | 4 + .../src/docs/user/scopes/list.mdx | 4 + .../app-web-docs/src/docs/user/scopes/map.mdx | 4 + .../src/docs/user/scopes/name.mdx | 46 + .../src/docs/user/scopes/namedFunction.mdx | 12 + .../docs/user/scopes/regularExpression.mdx | 4 + .../src/docs/user/scopes/statement.mdx | 90 + .../src/docs/user/scopes/value.mdx | 52 + .../src/references/languageReferences.ts | 4 + .../languageScopeSupport.ts | 2 + 43 files changed, 5035 insertions(+) create mode 100644 packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json create mode 100644 packages/app-web-docs/src/docs/user/languages/shellscript.mdx diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/interior.json b/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/interior.json index 4576a7ae0c9..094669a52eb 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/interior.json +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/interior.json @@ -4868,6 +4868,186 @@ } ] }, + { + "name": "scopes/shellscript/interior/interior.for", + "languageId": "shellscript", + "facet": "interior.for", + "code": "for ((foo = 0; foo < 2; foo++)); do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:36-0:38", + "removal": "0:35-0:39" + } + ], + "domain": "0:35-0:39" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.foreach", + "languageId": "shellscript", + "facet": "interior.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:20-0:22", + "removal": "0:19-0:23" + } + ], + "domain": "0:19-0:23" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.function", + "languageId": "shellscript", + "facet": "interior.function", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:7-0:8", + "removal": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.function2", + "languageId": "shellscript", + "facet": "interior.function", + "code": "function foo { }", + "scopes": [ + { + "targets": [ + { + "content": "0:14-0:15", + "removal": "0:14-0:15" + } + ], + "domain": "0:14-0:15" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.if", + "languageId": "shellscript", + "facet": "interior.if", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "1:2-1:3", + "removal": "0:13-2:0" + } + ], + "domain": "0:13-2:0" + }, + { + "targets": [ + { + "content": "3:2-3:3", + "removal": "2:16-4:0" + } + ], + "domain": "2:16-4:0" + }, + { + "targets": [ + { + "content": "5:2-5:3", + "removal": "4:4-6:0" + } + ], + "domain": "4:4-6:0" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.switch", + "languageId": "shellscript", + "facet": "interior.switch", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13", + "removal": "0:12-0:13" + } + ], + "domain": "0:12-0:13" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.switchCase", + "languageId": "shellscript", + "facet": "interior.switchCase", + "code": "case $foo in\n 0) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:2-1:9", + "removal": "0:12-2:0" + } + ], + "domain": "0:12-2:0" + }, + { + "targets": [ + { + "content": "1:5-1:6", + "removal": "1:4-1:7" + } + ], + "domain": "1:4-1:7" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.while", + "languageId": "shellscript", + "facet": "interior.while", + "code": "while foo; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:14-0:16", + "removal": "0:13-0:17" + } + ], + "domain": "0:13-0:17" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.while2", + "languageId": "shellscript", + "facet": "interior.while", + "code": "until foo; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:14-0:16", + "removal": "0:13-0:17" + } + ], + "domain": "0:13-0:17" + } + ] + }, { "name": "scopes/talon/interior.command", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/string.json b/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/string.json index 69c092e30d6..a075ba5b655 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/string.json +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/string.json @@ -594,6 +594,40 @@ } ] }, + { + "name": "scopes/shellscript/string.multiLine", + "languageId": "shellscript", + "facet": "string.multiLine", + "code": "\"Hello\nworld\"", + "scopes": [ + { + "targets": [ + { + "content": "0:0-1:6", + "removal": "0:0-1:6" + } + ], + "domain": "0:0-1:6" + } + ] + }, + { + "name": "scopes/shellscript/string.singleLine", + "languageId": "shellscript", + "facet": "string.singleLine", + "code": "\"Hello world\"", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, { "name": "scopes/talon/string.singleLine", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/textFragment.json b/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/textFragment.json index e6d513f217c..03938caf4f5 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/textFragment.json +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/fixtures/textFragment.json @@ -1360,6 +1360,57 @@ } ] }, + { + "name": "scopes/shellscript/textFragment.comment.line", + "languageId": "shellscript", + "facet": "textFragment.comment.line", + "code": "# Hello world", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/textFragment.string.multiLine", + "languageId": "shellscript", + "facet": "textFragment.string.multiLine", + "code": "\"Hello\nworld\"", + "scopes": [ + { + "targets": [ + { + "content": "0:1-1:5", + "removal": "0:1-1:5" + } + ], + "domain": "0:1-1:5" + } + ] + }, + { + "name": "scopes/shellscript/textFragment.string.singleLine", + "languageId": "shellscript", + "facet": "textFragment.string.singleLine", + "code": "\"Hello world\"", + "scopes": [ + { + "targets": [ + { + "content": "0:1-0:12", + "removal": "0:1-0:12" + } + ], + "domain": "0:1-0:12" + } + ] + }, { "name": "scopes/talon/textFragment.comment.line", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx index c765ed425a7..745de80175d 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/interior.mdx @@ -295,6 +295,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ### Interior: Foreach The body of a for-each loop @@ -357,6 +361,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### Talon @@ -429,6 +437,12 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + + + ### Interior: If The body of an if/elif/else branch @@ -497,6 +511,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### Talon @@ -757,6 +775,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ### Interior: Switch case The body of a case/default branch in a switch statement @@ -837,6 +859,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ### Interior: Try The body of a try/catch/finally branch @@ -943,4 +969,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + + + diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx index 4d8e58d3f2f..1f541ccf321 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/string.mdx @@ -89,6 +89,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### YAML @@ -177,6 +181,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### Talon list diff --git a/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx b/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx index d38f4a1f537..936aab6cd73 100644 --- a/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx +++ b/packages/app-web-docs/src/docs/contributing/private-scopes/textFragment.mdx @@ -195,6 +195,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### Talon list @@ -289,6 +293,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### YAML @@ -377,6 +385,10 @@ The following are internal scopes. They are not intended for user interaction or +##### Shell Script + + + ##### Talon list diff --git a/packages/app-web-docs/src/docs/user/languages/README.md b/packages/app-web-docs/src/docs/user/languages/README.md index 64ebe810e97..6a3a17ae2a8 100644 --- a/packages/app-web-docs/src/docs/user/languages/README.md +++ b/packages/app-web-docs/src/docs/user/languages/README.md @@ -32,6 +32,7 @@ sidebar_position: 4 - [Scala](./scala.mdx) - [Tree-sitter query (SCM)](./scm.mdx) - [SCSS](./scss.mdx) +- [Shell Script](./shellscript.mdx) - [Talon](./talon.mdx) - [Talon list](./talon-list.mdx) - [TypeScript](./typescript.mdx) diff --git a/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json b/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json new file mode 100644 index 00000000000..7c5fa150c08 --- /dev/null +++ b/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json @@ -0,0 +1,2029 @@ +[ + { + "name": "scopes/shellscript/argument/argument.actual.iteration", + "languageId": "shellscript", + "facet": "argument.actual.iteration", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/argument/argument.actual.multiLine", + "languageId": "shellscript", + "facet": "argument.actual.multiLine", + "code": "foo aaa \\\n bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:7", + "removal": "0:4-1:2" + } + ], + "domain": "0:4-0:7" + }, + { + "targets": [ + { + "content": "1:2-1:5", + "removal": "0:7-1:5" + } + ], + "domain": "1:2-1:5" + } + ] + }, + { + "name": "scopes/shellscript/argument/argument.actual.singleLine", + "languageId": "shellscript", + "facet": "argument.actual.singleLine", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:7", + "removal": "0:4-0:8" + } + ], + "domain": "0:4-0:7" + }, + { + "targets": [ + { + "content": "0:8-0:11", + "removal": "0:7-0:11" + } + ], + "domain": "0:8-0:11" + } + ] + }, + { + "name": "scopes/shellscript/argumentList.actual.empty", + "languageId": "shellscript", + "facet": "argumentList.actual.empty", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:3-0:3", + "removal": "0:3-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/argumentList.actual.multiLine", + "languageId": "shellscript", + "facet": "argumentList.actual.multiLine", + "code": "foo aaa \\\n bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-1:5", + "removal": "0:3-1:5" + } + ], + "domain": "0:0-1:5" + } + ] + }, + { + "name": "scopes/shellscript/argumentList.actual.singleLine", + "languageId": "shellscript", + "facet": "argumentList.actual.singleLine", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:11", + "removal": "0:3-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if.elif.else", + "languageId": "shellscript", + "facet": "branch.if.elif.else", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-1:5", + "removal": "0:0-2:2" + } + ], + "domain": "0:0-1:5" + }, + { + "targets": [ + { + "content": "2:0-3:5", + "removal": "2:0-4:0" + } + ], + "domain": "2:0-3:5" + }, + { + "targets": [ + { + "content": "4:0-5:5", + "removal": "4:0-6:0" + } + ], + "domain": "4:0-5:5" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if.else", + "languageId": "shellscript", + "facet": "branch.if.else", + "code": "if true; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-1:5", + "removal": "0:0-2:0" + } + ], + "domain": "0:0-1:5" + }, + { + "targets": [ + { + "content": "2:0-3:5", + "removal": "2:0-4:0" + } + ], + "domain": "2:0-3:5" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if.iteration", + "languageId": "shellscript", + "facet": "branch.if.iteration", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-3:2" + } + ], + "domain": "0:0-3:2" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if", + "languageId": "shellscript", + "facet": "branch.if", + "code": "if true; then :; fi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:19", + "removal": "0:0-0:19" + } + ], + "domain": "0:0-0:19" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.switchCase.iteration", + "languageId": "shellscript", + "facet": "branch.switchCase.iteration", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13" + } + ], + "domain": "0:12-0:13" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.switchCase", + "languageId": "shellscript", + "facet": "branch.switchCase", + "code": "case $foo in\n 0) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:4-1:11", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:11" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.switchCase2", + "languageId": "shellscript", + "facet": "branch.switchCase", + "code": "case $foo in\n *) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:4-1:11", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:11" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.ternary.iteration", + "languageId": "shellscript", + "facet": "branch.ternary.iteration", + "code": "((true ? 0 : 1))", + "scopes": [ + { + "targets": [ + { + "content": "0:2-0:14" + } + ], + "domain": "0:2-0:14" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.ternary", + "languageId": "shellscript", + "facet": "branch.ternary", + "code": "((true ? 0 : 1))", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:10", + "removal": "0:9-0:11" + } + ], + "domain": "0:9-0:10" + }, + { + "targets": [ + { + "content": "0:13-0:14", + "removal": "0:12-0:14" + } + ], + "domain": "0:13-0:14" + } + ] + }, + { + "name": "scopes/shellscript/comment.line", + "languageId": "shellscript", + "facet": "comment.line", + "code": "# Hello world", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.for", + "languageId": "shellscript", + "facet": "condition.for", + "code": "for ((i = 0; i < 2; i++)); do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:13-0:18", + "removal": "0:12-0:18" + } + ], + "domain": "0:0-0:37" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.if", + "languageId": "shellscript", + "facet": "condition.if", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:3-0:7", + "removal": "0:2-0:7" + } + ], + "domain": "0:0-3:2" + }, + { + "targets": [ + { + "content": "1:5-1:10", + "removal": "1:4-1:10" + } + ], + "domain": "1:0-1:16" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.switchCase.iteration", + "languageId": "shellscript", + "facet": "condition.switchCase.iteration", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13" + } + ], + "domain": "0:12-0:13" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.switchCase", + "languageId": "shellscript", + "facet": "condition.switchCase", + "code": "case $foo in\n 0) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:2-1:3", + "removal": "1:0-1:3" + } + ], + "domain": "1:2-1:9" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.ternary", + "languageId": "shellscript", + "facet": "condition.ternary", + "code": "((true ? 0 : 1))", + "scopes": [ + { + "targets": [ + { + "content": "0:2-0:6", + "removal": "0:2-0:7" + } + ], + "domain": "0:2-0:14" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.while", + "languageId": "shellscript", + "facet": "condition.while", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:10", + "removal": "0:5-0:10" + } + ], + "domain": "0:0-0:22" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.while2", + "languageId": "shellscript", + "facet": "condition.while", + "code": "until true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:10", + "removal": "0:5-0:10" + } + ], + "domain": "0:0-0:22" + } + ] + }, + { + "name": "scopes/shellscript/functionCall", + "languageId": "shellscript", + "facet": "functionCall", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/functionCall2", + "languageId": "shellscript", + "facet": "functionCall", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/functionCallee", + "languageId": "shellscript", + "facet": "functionCallee", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/functionCallee2", + "languageId": "shellscript", + "facet": "functionCallee", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:4" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/ifStatement", + "languageId": "shellscript", + "facet": "ifStatement", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-3:2", + "removal": "0:0-3:2" + } + ], + "domain": "0:0-3:2" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.for", + "languageId": "shellscript", + "facet": "interior.for", + "code": "for ((foo = 0; foo < 2; foo++)); do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:36-0:38", + "removal": "0:35-0:39" + } + ], + "domain": "0:35-0:39" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.foreach", + "languageId": "shellscript", + "facet": "interior.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:20-0:22", + "removal": "0:19-0:23" + } + ], + "domain": "0:19-0:23" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.function", + "languageId": "shellscript", + "facet": "interior.function", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:7-0:8", + "removal": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.function2", + "languageId": "shellscript", + "facet": "interior.function", + "code": "function foo { }", + "scopes": [ + { + "targets": [ + { + "content": "0:14-0:15", + "removal": "0:14-0:15" + } + ], + "domain": "0:14-0:15" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.if", + "languageId": "shellscript", + "facet": "interior.if", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "1:2-1:3", + "removal": "0:13-2:0" + } + ], + "domain": "0:13-2:0" + }, + { + "targets": [ + { + "content": "3:2-3:3", + "removal": "2:16-4:0" + } + ], + "domain": "2:16-4:0" + }, + { + "targets": [ + { + "content": "5:2-5:3", + "removal": "4:4-6:0" + } + ], + "domain": "4:4-6:0" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.switch", + "languageId": "shellscript", + "facet": "interior.switch", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13", + "removal": "0:12-0:13" + } + ], + "domain": "0:12-0:13" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.switchCase", + "languageId": "shellscript", + "facet": "interior.switchCase", + "code": "case $foo in\n 0) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:2-1:9", + "removal": "0:12-2:0" + } + ], + "domain": "0:12-2:0" + }, + { + "targets": [ + { + "content": "1:5-1:6", + "removal": "1:4-1:7" + } + ], + "domain": "1:4-1:7" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.while", + "languageId": "shellscript", + "facet": "interior.while", + "code": "while foo; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:14-0:16", + "removal": "0:13-0:17" + } + ], + "domain": "0:13-0:17" + } + ] + }, + { + "name": "scopes/shellscript/interior/interior.while2", + "languageId": "shellscript", + "facet": "interior.while", + "code": "until foo; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:14-0:16", + "removal": "0:13-0:17" + } + ], + "domain": "0:13-0:17" + } + ] + }, + { + "name": "scopes/shellscript/key.mapPair.iteration", + "languageId": "shellscript", + "facet": "key.mapPair.iteration", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:5-0:24" + } + ], + "domain": "0:5-0:24" + } + ] + }, + { + "name": "scopes/shellscript/key.mapPair", + "languageId": "shellscript", + "facet": "key.mapPair", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:11", + "removal": "0:6-0:11" + } + ], + "domain": "0:5-0:14" + }, + { + "targets": [ + { + "content": "0:16-0:21", + "removal": "0:16-0:21" + } + ], + "domain": "0:15-0:24" + } + ] + }, + { + "name": "scopes/shellscript/list", + "languageId": "shellscript", + "facet": "list", + "code": "foo=(aaa bbb)", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:13", + "removal": "0:4-0:13" + } + ], + "domain": "0:4-0:13" + } + ] + }, + { + "name": "scopes/shellscript/map", + "languageId": "shellscript", + "facet": "map", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:25", + "removal": "0:4-0:25" + } + ], + "domain": "0:4-0:25" + } + ] + }, + { + "name": "scopes/shellscript/name/name.assignment.compound", + "languageId": "shellscript", + "facet": "name.assignment.compound", + "code": "foo+=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:5" + } + ], + "domain": "0:0-0:6" + } + ] + }, + { + "name": "scopes/shellscript/name/name.assignment", + "languageId": "shellscript", + "facet": "name.assignment", + "code": "foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:4" + } + ], + "domain": "0:0-0:5" + } + ] + }, + { + "name": "scopes/shellscript/name/name.constant", + "languageId": "shellscript", + "facet": "name.constant", + "code": "readonly foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:12", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:14" + } + ] + }, + { + "name": "scopes/shellscript/name/name.foreach", + "languageId": "shellscript", + "facet": "name.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:5", + "removal": "0:4-0:6" + } + ], + "domain": "0:0-0:27" + } + ] + }, + { + "name": "scopes/shellscript/name/name.function", + "languageId": "shellscript", + "facet": "name.function", + "code": "foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:8" + } + ] + }, + { + "name": "scopes/shellscript/name/name.function2", + "languageId": "shellscript", + "facet": "name.function", + "code": "function foo {}", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:12", + "removal": "0:9-0:13" + } + ], + "domain": "0:0-0:15" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.block", + "languageId": "shellscript", + "facet": "name.iteration.block", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + }, + { + "targets": [ + { + "content": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.block2", + "languageId": "shellscript", + "facet": "name.iteration.block", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.block3", + "languageId": "shellscript", + "facet": "name.iteration.block", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:14-0:18" + } + ], + "domain": "0:14-0:18" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.document", + "languageId": "shellscript", + "facet": "name.iteration.document", + "code": "\ndeclare foo\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.initialized", + "languageId": "shellscript", + "facet": "name.variable.initialized", + "code": "local foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:9", + "removal": "0:0-0:10" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.initialized2", + "languageId": "shellscript", + "facet": "name.variable.initialized", + "code": "declare foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:8-0:11", + "removal": "0:0-0:12" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.uninitialized", + "languageId": "shellscript", + "facet": "name.variable.uninitialized", + "code": "declare foo", + "scopes": [ + { + "targets": [ + { + "content": "0:8-0:11", + "removal": "0:7-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.uninitialized2", + "languageId": "shellscript", + "facet": "name.variable.uninitialized", + "code": "local foo", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:9", + "removal": "0:5-0:9" + } + ], + "domain": "0:0-0:9" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction.iteration.document", + "languageId": "shellscript", + "facet": "namedFunction.iteration.document", + "code": "\nfoo() {}\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction", + "languageId": "shellscript", + "facet": "namedFunction", + "code": "foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:8", + "removal": "0:0-0:8" + } + ], + "domain": "0:0-0:8" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction2", + "languageId": "shellscript", + "facet": "namedFunction", + "code": "function foo {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:15", + "removal": "0:0-0:15" + } + ], + "domain": "0:0-0:15" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction3", + "languageId": "shellscript", + "facet": "namedFunction", + "code": "function foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:17", + "removal": "0:0-0:17" + } + ], + "domain": "0:0-0:17" + } + ] + }, + { + "name": "scopes/shellscript/regularExpression", + "languageId": "shellscript", + "facet": "regularExpression", + "code": "[[ $foo =~ ^\\w+$ ]]", + "scopes": [ + { + "targets": [ + { + "content": "0:11-0:16", + "removal": "0:11-0:17" + } + ], + "domain": "0:11-0:16" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.assignment.compound", + "languageId": "shellscript", + "facet": "statement.assignment.compound", + "code": "foo+=1", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:6", + "removal": "0:0-0:6" + } + ], + "domain": "0:0-0:6" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.assignment", + "languageId": "shellscript", + "facet": "statement.assignment", + "code": "foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:5", + "removal": "0:0-0:5" + } + ], + "domain": "0:0-0:5" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.break", + "languageId": "shellscript", + "facet": "statement.break", + "code": "while true; do\n break\ndone", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:4", + "removal": "0:0-2:4" + } + ], + "domain": "0:0-2:4" + }, + { + "targets": [ + { + "content": "1:4-1:9", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:9" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.constant", + "languageId": "shellscript", + "facet": "statement.constant", + "code": "readonly foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:14", + "removal": "0:0-0:14" + } + ], + "domain": "0:0-0:14" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.continue", + "languageId": "shellscript", + "facet": "statement.continue", + "code": "while true; do\n continue\ndone", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:4", + "removal": "0:0-2:4" + } + ], + "domain": "0:0-2:4" + }, + { + "targets": [ + { + "content": "1:4-1:12", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.for", + "languageId": "shellscript", + "facet": "statement.for", + "code": "for ((i = 0; i < 2; i++)); do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:37", + "removal": "0:0-0:37" + } + ], + "domain": "0:0-0:37" + }, + { + "targets": [ + { + "content": "0:30-0:31", + "removal": "0:29-0:31" + } + ], + "domain": "0:30-0:31" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.foreach", + "languageId": "shellscript", + "facet": "statement.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:27", + "removal": "0:0-0:27" + } + ], + "domain": "0:0-0:27" + }, + { + "targets": [ + { + "content": "0:20-0:21", + "removal": "0:19-0:21" + } + ], + "domain": "0:20-0:21" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.function", + "languageId": "shellscript", + "facet": "statement.function", + "code": "foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:8", + "removal": "0:0-0:8" + } + ], + "domain": "0:0-0:8" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.function2", + "languageId": "shellscript", + "facet": "statement.function", + "code": "function foo {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:15", + "removal": "0:0-0:15" + } + ], + "domain": "0:0-0:15" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.functionCall", + "languageId": "shellscript", + "facet": "statement.functionCall", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.functionCall2", + "languageId": "shellscript", + "facet": "statement.functionCall", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.if", + "languageId": "shellscript", + "facet": "statement.if", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-3:2", + "removal": "0:0-3:2" + } + ], + "domain": "0:0-3:2" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.import", + "languageId": "shellscript", + "facet": "statement.import", + "code": "source foo.sh", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.block", + "languageId": "shellscript", + "facet": "statement.iteration.block", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + }, + { + "targets": [ + { + "content": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.block2", + "languageId": "shellscript", + "facet": "statement.iteration.block", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.block3", + "languageId": "shellscript", + "facet": "statement.iteration.block", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:14-0:18" + } + ], + "domain": "0:14-0:18" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.document", + "languageId": "shellscript", + "facet": "statement.iteration.document", + "code": "\ndeclare foo\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.return", + "languageId": "shellscript", + "facet": "statement.return", + "code": "foo() {\n return 0\n}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:1", + "removal": "0:0-2:1" + } + ], + "domain": "0:0-2:1" + }, + { + "targets": [ + { + "content": "1:4-1:12", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.return2", + "languageId": "shellscript", + "facet": "statement.return", + "code": "function foo {\n return 0\n}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:1", + "removal": "0:0-2:1" + } + ], + "domain": "0:0-2:1" + }, + { + "targets": [ + { + "content": "1:4-1:12", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.switch", + "languageId": "shellscript", + "facet": "statement.switch", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:17", + "removal": "0:0-0:17" + } + ], + "domain": "0:0-0:17" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.update", + "languageId": "shellscript", + "facet": "statement.update", + "code": "((foo++))", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9", + "removal": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.variable.initialized", + "languageId": "shellscript", + "facet": "statement.variable.initialized", + "code": "local foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.variable.initialized2", + "languageId": "shellscript", + "facet": "statement.variable.initialized", + "code": "declare foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.variable.uninitialized", + "languageId": "shellscript", + "facet": "statement.variable.uninitialized", + "code": "declare foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.while", + "languageId": "shellscript", + "facet": "statement.while", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22", + "removal": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:15-0:16", + "removal": "0:14-0:16" + } + ], + "domain": "0:15-0:16" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.while2", + "languageId": "shellscript", + "facet": "statement.while", + "code": "until true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22", + "removal": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:15-0:16", + "removal": "0:14-0:16" + } + ], + "domain": "0:15-0:16" + } + ] + }, + { + "name": "scopes/shellscript/string.multiLine", + "languageId": "shellscript", + "facet": "string.multiLine", + "code": "\"Hello\nworld\"", + "scopes": [ + { + "targets": [ + { + "content": "0:0-1:6", + "removal": "0:0-1:6" + } + ], + "domain": "0:0-1:6" + } + ] + }, + { + "name": "scopes/shellscript/string.singleLine", + "languageId": "shellscript", + "facet": "string.singleLine", + "code": "\"Hello world\"", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/textFragment.comment.line", + "languageId": "shellscript", + "facet": "textFragment.comment.line", + "code": "# Hello world", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/textFragment.string.multiLine", + "languageId": "shellscript", + "facet": "textFragment.string.multiLine", + "code": "\"Hello\nworld\"", + "scopes": [ + { + "targets": [ + { + "content": "0:1-1:5", + "removal": "0:1-1:5" + } + ], + "domain": "0:1-1:5" + } + ] + }, + { + "name": "scopes/shellscript/textFragment.string.singleLine", + "languageId": "shellscript", + "facet": "textFragment.string.singleLine", + "code": "\"Hello world\"", + "scopes": [ + { + "targets": [ + { + "content": "0:1-0:12", + "removal": "0:1-0:12" + } + ], + "domain": "0:1-0:12" + } + ] + }, + { + "name": "scopes/shellscript/value/value.assignment.compound", + "languageId": "shellscript", + "facet": "value.assignment.compound", + "code": "foo+=0", + "scopes": [ + { + "targets": [ + { + "content": "0:5-0:6", + "removal": "0:3-0:6" + } + ], + "domain": "0:0-0:6" + } + ] + }, + { + "name": "scopes/shellscript/value/value.assignment", + "languageId": "shellscript", + "facet": "value.assignment", + "code": "foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:5", + "removal": "0:3-0:5" + } + ], + "domain": "0:0-0:5" + } + ] + }, + { + "name": "scopes/shellscript/value/value.constant", + "languageId": "shellscript", + "facet": "value.constant", + "code": "readonly foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:13-0:14", + "removal": "0:12-0:14" + } + ], + "domain": "0:0-0:14" + } + ] + }, + { + "name": "scopes/shellscript/value/value.foreach", + "languageId": "shellscript", + "facet": "value.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:15", + "removal": "0:8-0:15" + } + ], + "domain": "0:0-0:27" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.block", + "languageId": "shellscript", + "facet": "value.iteration.block", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + }, + { + "targets": [ + { + "content": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.block2", + "languageId": "shellscript", + "facet": "value.iteration.block", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.block3", + "languageId": "shellscript", + "facet": "value.iteration.block", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:14-0:18" + } + ], + "domain": "0:14-0:18" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.document", + "languageId": "shellscript", + "facet": "value.iteration.document", + "code": "\ndeclare foo\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/value/value.mapPair.iteration", + "languageId": "shellscript", + "facet": "value.mapPair.iteration", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:25" + } + ], + "domain": "0:0-0:25" + }, + { + "targets": [ + { + "content": "0:5-0:24" + } + ], + "domain": "0:5-0:24" + } + ] + }, + { + "name": "scopes/shellscript/value/value.mapPair", + "languageId": "shellscript", + "facet": "value.mapPair", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:25", + "removal": "0:3-0:25" + } + ], + "domain": "0:0-0:25" + }, + { + "targets": [ + { + "content": "0:13-0:14", + "removal": "0:13-0:14" + } + ], + "domain": "0:5-0:14" + }, + { + "targets": [ + { + "content": "0:23-0:24", + "removal": "0:23-0:24" + } + ], + "domain": "0:15-0:24" + } + ] + }, + { + "name": "scopes/shellscript/value/value.return", + "languageId": "shellscript", + "facet": "value.return", + "code": "foo() {\n return 0;\n}", + "scopes": [ + { + "targets": [ + { + "content": "1:11-1:12", + "removal": "1:10-1:12" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/value/value.return2", + "languageId": "shellscript", + "facet": "value.return", + "code": "function foo {\n return 0;\n}", + "scopes": [ + { + "targets": [ + { + "content": "1:11-1:12", + "removal": "1:10-1:12" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/value/value.switch", + "languageId": "shellscript", + "facet": "value.switch", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:5-0:9", + "removal": "0:5-0:10" + } + ], + "domain": "0:0-0:17" + } + ] + }, + { + "name": "scopes/shellscript/value/value.variable", + "languageId": "shellscript", + "facet": "value.variable", + "code": "local foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:10-0:11", + "removal": "0:9-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/value/value.variable2", + "languageId": "shellscript", + "facet": "value.variable", + "code": "declare foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13", + "removal": "0:11-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + } +] diff --git a/packages/app-web-docs/src/docs/user/languages/shellscript.mdx b/packages/app-web-docs/src/docs/user/languages/shellscript.mdx new file mode 100644 index 00000000000..cd883c91857 --- /dev/null +++ b/packages/app-web-docs/src/docs/user/languages/shellscript.mdx @@ -0,0 +1,596 @@ +import { ScopeVisualizer, ScopeVisualizerOptions, ScopeVisualizerProvider } from "@site/src/docs/components/ScopeVisualizer"; +import scopeTests from "./fixtures/shellscript.json"; + +# Shell Script + + + +Below are visualizations of all our scope tests for this language. These were created primarily for testing purposes rather than as documentation. There are quite a few, and they may feel a bit overwhelming from a documentation standpoint. + +## Scopes + + + +### Argument list + +#### 1. Argument list: Actual empty + +An empty list of arguments in a function call. Insertion delimiter should be empty. + + + +#### 2. Argument list: Actual multi line + +A multi-line list of arguments in a function call. Insertion delimiter should include a newline. + + + +#### 3. Argument list: Actual single line + +A single-line list of arguments in a function call + + + +### Argument or parameter + +#### 1. Argument: Actual multi line + +A multi-line argument in a function call. Insertion delimiter should include a newline. + + + +#### 2. Argument: Actual single line + +A single-line argument in a function call + + + +#### 3. Argument: Actual (iteration) + +Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. + + + +### Branch + +#### 1. Branch: If + +An if branch + + + +#### 2. Branch: If elif else + +An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. + + + +#### 3. Branch: If else + +An if-else branch + + + +#### 4. Branch: Switch case + +A case/default branch in a switch statement + + + + + +#### 5. Branch: Ternary + +A branch in a ternary expression + + + +#### 6. Branch: If (iteration) + +Iteration scope for if/elif/else branches: the if/elif/else statement. + + + +#### 7. Branch: Switch case (iteration) + +Iteration scope for case/default branches in a switch statement: the switch statement body. + + + +#### 8. Branch: Ternary (iteration) + +Iteration scope for ternary expression branches: the ternary expression. + + + +### Collection key + +#### 1. Key: Map pair + +Key (LHS) of a key-value pair in a map + + + +#### 2. Key: Map pair (iteration) + +Iteration scope for keys of key-value pairs in a map: should be between the braces. + + + +### Comment + +#### 1. Comment: Line + +A line comment + + + +### Condition + +#### 1. Condition: For + +A condition in a for loop + + + +#### 2. Condition: If + +A condition in an if statement + + + +#### 3. Condition: Switch case + +A condition in a switch statement + + + +#### 4. Condition: Ternary + +A condition in a ternary expression + + + +#### 5. Condition: While + +A condition in a while loop + + + + + +#### 6. Condition: Switch case (iteration) + +Iteration scope for conditions in a switch statement: the switch statement body. + + + +### Function call + +#### 1. Function call + +A function call + + + + + +### Function callee + +#### 1. Function callee + +The function being called in a function call + + + + + +### If statement + +#### 1. If statement + +An if statement + + + +### List + +#### 1. List + +A list/array + + + +### Map + +#### 1. Map + +A map/dictionary + + + +### Name + +#### 1. Name: Assignment + +Name (LHS) of an assignment statement + + + +#### 2. Name: Assignment compound + +Name (LHS) of a compound assignment statement, eg +=/-= + + + +#### 3. Name: Constant + +Name (LHS) of a constant declaration + + + +#### 4. Name: Foreach + +Iteration variable name in a for-each loop + + + +#### 5. Name: Function + +Name of a function declaration + + + + + +#### 6. Name: Variable initialized + +Name (LHS) of an initialized variable declaration + + + + + +#### 7. Name: Variable uninitialized + +Name (LHS) of an uninitialized variable declaration + + + + + +#### 8. Name (iteration block) + +Iteration scope for names: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 9. Name (iteration document) + +Iteration scope for names: the entire document including leading and trailing empty lines. + + + +### Named function + +#### 1. Named function + +A named function declaration + + + + + + + +#### 2. Named function (iteration document) + +Iteration scope for named functions: the entire document including leading and trailing empty lines. + + + +### Regular expression + +#### 1. Regular expression + +A regular expression + + + +### Statement + +#### 1. Statement: Assignment + +An assignment statement + + + +#### 2. Statement: Assignment compound + +A compound assignment statement, eg +=/-= + + + +#### 3. Statement: Break + +A break statement + + + +#### 4. Statement: Constant + +A constant declaration + + + +#### 5. Statement: Continue + +A continue statement + + + +#### 6. Statement: For + +A for loop + + + +#### 7. Statement: Foreach + +A for-each loop + + + +#### 8. Statement: Function + +A named function declaration + + + + + +#### 9. Statement: Function call + +A function call statement + + + + + +#### 10. Statement: If + +An if/elif/else statement + + + +#### 11. Statement: Import + +An import statement + + + +#### 12. Statement: Return + +A return statement + + + + + +#### 13. Statement: Switch + +A switch statement + + + +#### 14. Statement: Update + +An update statement, eg ++/-- + + + +#### 15. Statement: Variable initialized + +An initialized variable declaration + + + + + +#### 16. Statement: Variable uninitialized + +An uninitialized variable declaration + + + +#### 17. Statement: While + +A while loop + + + + + +#### 18. Statement (iteration block) + +Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 19. Statement (iteration document) + +Iteration scope for statements: the entire document including leading and trailing empty lines. + + + +### Value + +#### 1. Value: Assignment + +Value (RHS) of an assignment statement + + + +#### 2. Value: Assignment compound + +Value (RHS) of a compound assignment statement, eg +=/-= + + + +#### 3. Value: Constant + +Value (RHS) of a constant declaration + + + +#### 4. Value: Foreach + +Iterable in a for-each loop + + + +#### 5. Value: Map pair + +Value (RHS) of a key-value pair in a map + + + +#### 6. Value: Return + +Return value of a function + + + + + +#### 7. Value: Switch + +Value / subject of a switch statement + + + +#### 8. Value: Variable + +Value (RHS) of a variable declaration + + + + + +#### 9. Value (iteration block) + +Iteration scope for values: statement blocks (body of functions/if-statements/for-loops/etc). + + + + + + + +#### 10. Value (iteration document) + +Iteration scope for values: the entire document including leading and trailing empty lines. + + + +#### 11. Value: Map pair (iteration) + +Iteration scope for values of key-value pairs in a map: should be between the braces. + + + +## Internal scopes + +The following are internal scopes. They are not intended for user interaction or spoken use. These scopes exist solely for internal Cursorless functionality. + +### Interior + +#### 1. Interior: For + +The body of a for loop + + + +#### 2. Interior: Foreach + +The body of a for-each loop + + + +#### 3. Interior: Function + +The body of a function declaration + + + + + +#### 4. Interior: If + +The body of an if/elif/else branch + + + +#### 5. Interior: Switch + +The body of a switch statement + + + +#### 6. Interior: Switch case + +The body of a case/default branch in a switch statement + + + +#### 7. Interior: While + +The body of a while loop + + + + + +### String + +#### 1. String: Multi line + +A multi-line string + + + +#### 2. String: Single line + +A single-line string + + + +### Text fragment + +#### 1. Text fragment: Comment line + +Internally used text fragment consisting of a line comment + + + +#### 2. Text fragment: String multi line + +Internally used text fragment consisting of a multi-line string + + + +#### 3. Text fragment: String single line + +Internally used text fragment consisting of a single-line string + + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx b/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx index 5a81785acce..965e17ad887 100644 --- a/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx @@ -225,6 +225,10 @@ Default: `arg list` +##### Shell Script + + + ##### Talon @@ -549,6 +553,10 @@ Default: `arg list` +##### Shell Script + + + ### Argument list: Actual single line A single-line list of arguments in a function call @@ -623,6 +631,10 @@ Default: `arg list` +##### Shell Script + + + ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx b/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx index d0eca0b6bb1..211f1783b11 100644 --- a/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx @@ -353,6 +353,10 @@ Default: `arg` +##### Shell Script + + + ### Argument: Actual single line A single-line argument in a function call @@ -445,6 +449,10 @@ Default: `arg` +##### Shell Script + + + ##### Talon @@ -1013,6 +1021,10 @@ Default: `arg` +##### Shell Script + + + ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/branch.mdx b/packages/app-web-docs/src/docs/user/scopes/branch.mdx index 048d35a0cf1..baa502a0569 100644 --- a/packages/app-web-docs/src/docs/user/scopes/branch.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/branch.mdx @@ -91,6 +91,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: If elif else An if-elif-else branch. The removal range for the if branch should include the trailing `else` keyword. @@ -155,6 +159,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: If else An if-else branch @@ -219,6 +227,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: Loop A for / while loop branch. For most languages this is not supported, but eg in Python you can have an else branch for a loop. @@ -315,6 +327,12 @@ Default: `branch` +##### Shell Script + + + + + ### Branch: Ternary A branch in a ternary expression @@ -355,6 +373,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: Try A try/catch/finally branch @@ -469,6 +491,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: Loop (iteration) Iteration scope for loop branches: the loop statement. @@ -539,6 +565,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: Ternary (iteration) Iteration scope for ternary expression branches: the ternary expression. @@ -579,6 +609,10 @@ Default: `branch` +##### Shell Script + + + ### Branch: Try (iteration) Iteration scope for try/catch/finally branches: the try/catch/finally statement. diff --git a/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx b/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx index 2fcac46cf4f..8f65b4494d2 100644 --- a/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx @@ -107,6 +107,10 @@ Default: `key` +##### Shell Script + + + ##### Talon list @@ -181,6 +185,10 @@ Default: `key` +##### Shell Script + + + ##### Talon list diff --git a/packages/app-web-docs/src/docs/user/scopes/comment.mdx b/packages/app-web-docs/src/docs/user/scopes/comment.mdx index 4bc58fca3a3..61fb07c692d 100644 --- a/packages/app-web-docs/src/docs/user/scopes/comment.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/comment.mdx @@ -195,6 +195,10 @@ Default: `comment` +##### Shell Script + + + ##### Talon list diff --git a/packages/app-web-docs/src/docs/user/scopes/condition.mdx b/packages/app-web-docs/src/docs/user/scopes/condition.mdx index 33d3922aeee..d6d5a1bcafb 100644 --- a/packages/app-web-docs/src/docs/user/scopes/condition.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/condition.mdx @@ -103,6 +103,10 @@ Default: `condition` +##### Shell Script + + + ### Condition: If A condition in an if statement @@ -171,6 +175,10 @@ Default: `condition` +##### Shell Script + + + ##### Talon @@ -253,6 +261,10 @@ Default: `condition` +##### Shell Script + + + ### Condition: Ternary A condition in a ternary expression @@ -293,6 +305,10 @@ Default: `condition` +##### Shell Script + + + ### Condition: While A condition in a while loop @@ -349,6 +365,12 @@ Default: `condition` +##### Shell Script + + + + + ### Condition: Switch case (iteration) Iteration scope for conditions in a switch statement: the switch statement body. @@ -409,4 +431,8 @@ Default: `condition` +##### Shell Script + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentList.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentList.json index cd775e34c22..95b14d421d3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentList.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentList.json @@ -5415,6 +5415,57 @@ } ] }, + { + "name": "scopes/shellscript/argumentList.actual.empty", + "languageId": "shellscript", + "facet": "argumentList.actual.empty", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:3-0:3", + "removal": "0:3-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/argumentList.actual.multiLine", + "languageId": "shellscript", + "facet": "argumentList.actual.multiLine", + "code": "foo aaa \\\n bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-1:5", + "removal": "0:3-1:5" + } + ], + "domain": "0:0-1:5" + } + ] + }, + { + "name": "scopes/shellscript/argumentList.actual.singleLine", + "languageId": "shellscript", + "facet": "argumentList.actual.singleLine", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:11", + "removal": "0:3-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, { "name": "scopes/talon/argumentList/argumentList.actual.empty", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentOrParameter.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentOrParameter.json index 132a82b39c2..f89c2c6ff96 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentOrParameter.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/argumentOrParameter.json @@ -7658,6 +7658,74 @@ } ] }, + { + "name": "scopes/shellscript/argument/argument.actual.iteration", + "languageId": "shellscript", + "facet": "argument.actual.iteration", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/argument/argument.actual.multiLine", + "languageId": "shellscript", + "facet": "argument.actual.multiLine", + "code": "foo aaa \\\n bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:7", + "removal": "0:4-1:2" + } + ], + "domain": "0:4-0:7" + }, + { + "targets": [ + { + "content": "1:2-1:5", + "removal": "0:7-1:5" + } + ], + "domain": "1:2-1:5" + } + ] + }, + { + "name": "scopes/shellscript/argument/argument.actual.singleLine", + "languageId": "shellscript", + "facet": "argument.actual.singleLine", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:7", + "removal": "0:4-0:8" + } + ], + "domain": "0:4-0:7" + }, + { + "targets": [ + { + "content": "0:8-0:11", + "removal": "0:7-0:11" + } + ], + "domain": "0:8-0:11" + } + ] + }, { "name": "scopes/talon/argument/argument.actual.iteration", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/branch.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/branch.json index cb35cfaec7e..7e7ad75716c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/branch.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/branch.json @@ -3173,5 +3173,191 @@ "domain": "0:0-0:11" } ] + }, + { + "name": "scopes/shellscript/branch/branch.if.elif.else", + "languageId": "shellscript", + "facet": "branch.if.elif.else", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-1:5", + "removal": "0:0-2:2" + } + ], + "domain": "0:0-1:5" + }, + { + "targets": [ + { + "content": "2:0-3:5", + "removal": "2:0-4:0" + } + ], + "domain": "2:0-3:5" + }, + { + "targets": [ + { + "content": "4:0-5:5", + "removal": "4:0-6:0" + } + ], + "domain": "4:0-5:5" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if.else", + "languageId": "shellscript", + "facet": "branch.if.else", + "code": "if true; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-1:5", + "removal": "0:0-2:0" + } + ], + "domain": "0:0-1:5" + }, + { + "targets": [ + { + "content": "2:0-3:5", + "removal": "2:0-4:0" + } + ], + "domain": "2:0-3:5" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if.iteration", + "languageId": "shellscript", + "facet": "branch.if.iteration", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-3:2" + } + ], + "domain": "0:0-3:2" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.if", + "languageId": "shellscript", + "facet": "branch.if", + "code": "if true; then :; fi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:19", + "removal": "0:0-0:19" + } + ], + "domain": "0:0-0:19" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.switchCase.iteration", + "languageId": "shellscript", + "facet": "branch.switchCase.iteration", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13" + } + ], + "domain": "0:12-0:13" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.switchCase", + "languageId": "shellscript", + "facet": "branch.switchCase", + "code": "case $foo in\n 0) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:4-1:11", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:11" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.switchCase2", + "languageId": "shellscript", + "facet": "branch.switchCase", + "code": "case $foo in\n *) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:4-1:11", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:11" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.ternary.iteration", + "languageId": "shellscript", + "facet": "branch.ternary.iteration", + "code": "((true ? 0 : 1))", + "scopes": [ + { + "targets": [ + { + "content": "0:2-0:14" + } + ], + "domain": "0:2-0:14" + } + ] + }, + { + "name": "scopes/shellscript/branch/branch.ternary", + "languageId": "shellscript", + "facet": "branch.ternary", + "code": "((true ? 0 : 1))", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:10", + "removal": "0:9-0:11" + } + ], + "domain": "0:9-0:10" + }, + { + "targets": [ + { + "content": "0:13-0:14", + "removal": "0:12-0:14" + } + ], + "domain": "0:13-0:14" + } + ] } ] diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/collectionKey.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/collectionKey.json index f9b4330b3ae..dfa4bed4bae 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/collectionKey.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/collectionKey.json @@ -671,6 +671,48 @@ } ] }, + { + "name": "scopes/shellscript/key.mapPair.iteration", + "languageId": "shellscript", + "facet": "key.mapPair.iteration", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:5-0:24" + } + ], + "domain": "0:5-0:24" + } + ] + }, + { + "name": "scopes/shellscript/key.mapPair", + "languageId": "shellscript", + "facet": "key.mapPair", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:11", + "removal": "0:6-0:11" + } + ], + "domain": "0:5-0:14" + }, + { + "targets": [ + { + "content": "0:16-0:21", + "removal": "0:16-0:21" + } + ], + "domain": "0:15-0:24" + } + ] + }, { "name": "scopes/talon/key/key.mapPair.iteration", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/comment.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/comment.json index dc2fcfef7e2..59bfe0a6fe5 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/comment.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/comment.json @@ -696,6 +696,23 @@ } ] }, + { + "name": "scopes/shellscript/comment.line", + "languageId": "shellscript", + "facet": "comment.line", + "code": "# Hello world", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, { "name": "scopes/talon/comment.line", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/condition.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/condition.json index 0383798f759..d47bb1f43c8 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/condition.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/condition.json @@ -1717,6 +1717,133 @@ } ] }, + { + "name": "scopes/shellscript/condition/condition.for", + "languageId": "shellscript", + "facet": "condition.for", + "code": "for ((i = 0; i < 2; i++)); do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:13-0:18", + "removal": "0:12-0:18" + } + ], + "domain": "0:0-0:37" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.if", + "languageId": "shellscript", + "facet": "condition.if", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:3-0:7", + "removal": "0:2-0:7" + } + ], + "domain": "0:0-3:2" + }, + { + "targets": [ + { + "content": "1:5-1:10", + "removal": "1:4-1:10" + } + ], + "domain": "1:0-1:16" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.switchCase.iteration", + "languageId": "shellscript", + "facet": "condition.switchCase.iteration", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13" + } + ], + "domain": "0:12-0:13" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.switchCase", + "languageId": "shellscript", + "facet": "condition.switchCase", + "code": "case $foo in\n 0) : ;;\nesac", + "scopes": [ + { + "targets": [ + { + "content": "1:2-1:3", + "removal": "1:0-1:3" + } + ], + "domain": "1:2-1:9" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.ternary", + "languageId": "shellscript", + "facet": "condition.ternary", + "code": "((true ? 0 : 1))", + "scopes": [ + { + "targets": [ + { + "content": "0:2-0:6", + "removal": "0:2-0:7" + } + ], + "domain": "0:2-0:14" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.while", + "languageId": "shellscript", + "facet": "condition.while", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:10", + "removal": "0:5-0:10" + } + ], + "domain": "0:0-0:22" + } + ] + }, + { + "name": "scopes/shellscript/condition/condition.while2", + "languageId": "shellscript", + "facet": "condition.while", + "code": "until true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:10", + "removal": "0:5-0:10" + } + ], + "domain": "0:0-0:22" + } + ] + }, { "name": "scopes/talon/condition.if", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCall.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCall.json index 7495b023424..fdc04209ec7 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCall.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCall.json @@ -1349,6 +1349,40 @@ } ] }, + { + "name": "scopes/shellscript/functionCall", + "languageId": "shellscript", + "facet": "functionCall", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/functionCall2", + "languageId": "shellscript", + "facet": "functionCall", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, { "name": "scopes/talon/functionCall.method", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCallee.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCallee.json index 7f872062036..6dd457b98ee 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCallee.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/functionCallee.json @@ -1349,6 +1349,40 @@ } ] }, + { + "name": "scopes/shellscript/functionCallee", + "languageId": "shellscript", + "facet": "functionCallee", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/functionCallee2", + "languageId": "shellscript", + "facet": "functionCallee", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:4" + } + ], + "domain": "0:0-0:11" + } + ] + }, { "name": "scopes/talon/functionCallee.method", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/ifStatement.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/ifStatement.json index fc4b6e49d4e..9789c6912be 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/ifStatement.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/ifStatement.json @@ -271,6 +271,23 @@ } ] }, + { + "name": "scopes/shellscript/ifStatement", + "languageId": "shellscript", + "facet": "ifStatement", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-3:2", + "removal": "0:0-3:2" + } + ], + "domain": "0:0-3:2" + } + ] + }, { "name": "scopes/talon/ifStatement", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/list.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/list.json index 9882297992c..f81dd46a068 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/list.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/list.json @@ -475,6 +475,23 @@ } ] }, + { + "name": "scopes/shellscript/list", + "languageId": "shellscript", + "facet": "list", + "code": "foo=(aaa bbb)", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:13", + "removal": "0:4-0:13" + } + ], + "domain": "0:4-0:13" + } + ] + }, { "name": "scopes/yaml/list", "languageId": "yaml", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/map.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/map.json index 5176eb10814..5dcd665e45e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/map.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/map.json @@ -314,6 +314,23 @@ } ] }, + { + "name": "scopes/shellscript/map", + "languageId": "shellscript", + "facet": "map", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:25", + "removal": "0:4-0:25" + } + ], + "domain": "0:4-0:25" + } + ] + }, { "name": "scopes/yaml/map", "languageId": "yaml", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json index e12e130fe98..3dccbef93da 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json @@ -11957,6 +11957,256 @@ } ] }, + { + "name": "scopes/shellscript/name/name.assignment.compound", + "languageId": "shellscript", + "facet": "name.assignment.compound", + "code": "foo+=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:5" + } + ], + "domain": "0:0-0:6" + } + ] + }, + { + "name": "scopes/shellscript/name/name.assignment", + "languageId": "shellscript", + "facet": "name.assignment", + "code": "foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:4" + } + ], + "domain": "0:0-0:5" + } + ] + }, + { + "name": "scopes/shellscript/name/name.constant", + "languageId": "shellscript", + "facet": "name.constant", + "code": "readonly foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:12", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:14" + } + ] + }, + { + "name": "scopes/shellscript/name/name.foreach", + "languageId": "shellscript", + "facet": "name.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:5", + "removal": "0:4-0:6" + } + ], + "domain": "0:0-0:27" + } + ] + }, + { + "name": "scopes/shellscript/name/name.function", + "languageId": "shellscript", + "facet": "name.function", + "code": "foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:8" + } + ] + }, + { + "name": "scopes/shellscript/name/name.function2", + "languageId": "shellscript", + "facet": "name.function", + "code": "function foo {}", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:12", + "removal": "0:9-0:13" + } + ], + "domain": "0:0-0:15" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.block", + "languageId": "shellscript", + "facet": "name.iteration.block", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + }, + { + "targets": [ + { + "content": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.block2", + "languageId": "shellscript", + "facet": "name.iteration.block", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.block3", + "languageId": "shellscript", + "facet": "name.iteration.block", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:14-0:18" + } + ], + "domain": "0:14-0:18" + } + ] + }, + { + "name": "scopes/shellscript/name/name.iteration.document", + "languageId": "shellscript", + "facet": "name.iteration.document", + "code": "\ndeclare foo\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.initialized", + "languageId": "shellscript", + "facet": "name.variable.initialized", + "code": "local foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:9", + "removal": "0:0-0:10" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.initialized2", + "languageId": "shellscript", + "facet": "name.variable.initialized", + "code": "declare foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:8-0:11", + "removal": "0:0-0:12" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.uninitialized", + "languageId": "shellscript", + "facet": "name.variable.uninitialized", + "code": "declare foo", + "scopes": [ + { + "targets": [ + { + "content": "0:8-0:11", + "removal": "0:7-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/name/name.variable.uninitialized2", + "languageId": "shellscript", + "facet": "name.variable.uninitialized", + "code": "local foo", + "scopes": [ + { + "targets": [ + { + "content": "0:6-0:9", + "removal": "0:5-0:9" + } + ], + "domain": "0:0-0:9" + } + ] + }, { "name": "scopes/talon/name/name.assignment", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json index e40d5075bd4..5e6d39ad848 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json @@ -1893,6 +1893,73 @@ } ] }, + { + "name": "scopes/shellscript/namedFunction/namedFunction.iteration.document", + "languageId": "shellscript", + "facet": "namedFunction.iteration.document", + "code": "\nfoo() {}\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction", + "languageId": "shellscript", + "facet": "namedFunction", + "code": "foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:8", + "removal": "0:0-0:8" + } + ], + "domain": "0:0-0:8" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction2", + "languageId": "shellscript", + "facet": "namedFunction", + "code": "function foo {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:15", + "removal": "0:0-0:15" + } + ], + "domain": "0:0-0:15" + } + ] + }, + { + "name": "scopes/shellscript/namedFunction/namedFunction3", + "languageId": "shellscript", + "facet": "namedFunction", + "code": "function foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:17", + "removal": "0:0-0:17" + } + ], + "domain": "0:0-0:17" + } + ] + }, { "name": "scopes/typescript.core/namedFunction/namedFunction.constructor", "languageId": "typescript.core", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/regularExpression.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/regularExpression.json index 8b16de0bf2d..1623983a7fb 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/regularExpression.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/regularExpression.json @@ -32,5 +32,22 @@ "domain": "0:0-0:8" } ] + }, + { + "name": "scopes/shellscript/regularExpression", + "languageId": "shellscript", + "facet": "regularExpression", + "code": "[[ $foo =~ ^\\w+$ ]]", + "scopes": [ + { + "targets": [ + { + "content": "0:11-0:16", + "removal": "0:11-0:17" + } + ], + "domain": "0:11-0:16" + } + ] } ] diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json index 6aad6cfbe97..2c4e9a5e089 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json @@ -10592,6 +10592,532 @@ } ] }, + { + "name": "scopes/shellscript/statement/statement.assignment.compound", + "languageId": "shellscript", + "facet": "statement.assignment.compound", + "code": "foo+=1", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:6", + "removal": "0:0-0:6" + } + ], + "domain": "0:0-0:6" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.assignment", + "languageId": "shellscript", + "facet": "statement.assignment", + "code": "foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:5", + "removal": "0:0-0:5" + } + ], + "domain": "0:0-0:5" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.break", + "languageId": "shellscript", + "facet": "statement.break", + "code": "while true; do\n break\ndone", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:4", + "removal": "0:0-2:4" + } + ], + "domain": "0:0-2:4" + }, + { + "targets": [ + { + "content": "1:4-1:9", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:9" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.constant", + "languageId": "shellscript", + "facet": "statement.constant", + "code": "readonly foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:14", + "removal": "0:0-0:14" + } + ], + "domain": "0:0-0:14" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.continue", + "languageId": "shellscript", + "facet": "statement.continue", + "code": "while true; do\n continue\ndone", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:4", + "removal": "0:0-2:4" + } + ], + "domain": "0:0-2:4" + }, + { + "targets": [ + { + "content": "1:4-1:12", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.for", + "languageId": "shellscript", + "facet": "statement.for", + "code": "for ((i = 0; i < 2; i++)); do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:37", + "removal": "0:0-0:37" + } + ], + "domain": "0:0-0:37" + }, + { + "targets": [ + { + "content": "0:30-0:31", + "removal": "0:29-0:31" + } + ], + "domain": "0:30-0:31" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.foreach", + "languageId": "shellscript", + "facet": "statement.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:27", + "removal": "0:0-0:27" + } + ], + "domain": "0:0-0:27" + }, + { + "targets": [ + { + "content": "0:20-0:21", + "removal": "0:19-0:21" + } + ], + "domain": "0:20-0:21" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.function", + "languageId": "shellscript", + "facet": "statement.function", + "code": "foo() {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:8", + "removal": "0:0-0:8" + } + ], + "domain": "0:0-0:8" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.function2", + "languageId": "shellscript", + "facet": "statement.function", + "code": "function foo {}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:15", + "removal": "0:0-0:15" + } + ], + "domain": "0:0-0:15" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.functionCall", + "languageId": "shellscript", + "facet": "statement.functionCall", + "code": "foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:3", + "removal": "0:0-0:3" + } + ], + "domain": "0:0-0:3" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.functionCall2", + "languageId": "shellscript", + "facet": "statement.functionCall", + "code": "foo aaa bbb", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.if", + "languageId": "shellscript", + "facet": "statement.if", + "code": "if true; then\nelif false; then\nelse\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-3:2", + "removal": "0:0-3:2" + } + ], + "domain": "0:0-3:2" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.import", + "languageId": "shellscript", + "facet": "statement.import", + "code": "source foo.sh", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.block", + "languageId": "shellscript", + "facet": "statement.iteration.block", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + }, + { + "targets": [ + { + "content": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.block2", + "languageId": "shellscript", + "facet": "statement.iteration.block", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.block3", + "languageId": "shellscript", + "facet": "statement.iteration.block", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:14-0:18" + } + ], + "domain": "0:14-0:18" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.iteration.document", + "languageId": "shellscript", + "facet": "statement.iteration.document", + "code": "\ndeclare foo\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.return", + "languageId": "shellscript", + "facet": "statement.return", + "code": "foo() {\n return 0\n}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:1", + "removal": "0:0-2:1" + } + ], + "domain": "0:0-2:1" + }, + { + "targets": [ + { + "content": "1:4-1:12", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.return2", + "languageId": "shellscript", + "facet": "statement.return", + "code": "function foo {\n return 0\n}", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:1", + "removal": "0:0-2:1" + } + ], + "domain": "0:0-2:1" + }, + { + "targets": [ + { + "content": "1:4-1:12", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.switch", + "languageId": "shellscript", + "facet": "statement.switch", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:17", + "removal": "0:0-0:17" + } + ], + "domain": "0:0-0:17" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.update", + "languageId": "shellscript", + "facet": "statement.update", + "code": "((foo++))", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9", + "removal": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.variable.initialized", + "languageId": "shellscript", + "facet": "statement.variable.initialized", + "code": "local foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.variable.initialized2", + "languageId": "shellscript", + "facet": "statement.variable.initialized", + "code": "declare foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:13", + "removal": "0:0-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.variable.uninitialized", + "languageId": "shellscript", + "facet": "statement.variable.uninitialized", + "code": "declare foo", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:11", + "removal": "0:0-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.while", + "languageId": "shellscript", + "facet": "statement.while", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22", + "removal": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:15-0:16", + "removal": "0:14-0:16" + } + ], + "domain": "0:15-0:16" + } + ] + }, + { + "name": "scopes/shellscript/statement/statement.while2", + "languageId": "shellscript", + "facet": "statement.while", + "code": "until true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22", + "removal": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:15-0:16", + "removal": "0:14-0:16" + } + ], + "domain": "0:15-0:16" + } + ] + }, { "name": "scopes/talon/statement.assignment", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json index 7e83d6749d9..83c6f4a12a8 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json @@ -8544,6 +8544,298 @@ } ] }, + { + "name": "scopes/shellscript/value/value.assignment.compound", + "languageId": "shellscript", + "facet": "value.assignment.compound", + "code": "foo+=0", + "scopes": [ + { + "targets": [ + { + "content": "0:5-0:6", + "removal": "0:3-0:6" + } + ], + "domain": "0:0-0:6" + } + ] + }, + { + "name": "scopes/shellscript/value/value.assignment", + "languageId": "shellscript", + "facet": "value.assignment", + "code": "foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:5", + "removal": "0:3-0:5" + } + ], + "domain": "0:0-0:5" + } + ] + }, + { + "name": "scopes/shellscript/value/value.constant", + "languageId": "shellscript", + "facet": "value.constant", + "code": "readonly foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:13-0:14", + "removal": "0:12-0:14" + } + ], + "domain": "0:0-0:14" + } + ] + }, + { + "name": "scopes/shellscript/value/value.foreach", + "languageId": "shellscript", + "facet": "value.foreach", + "code": "for v in values; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:9-0:15", + "removal": "0:8-0:15" + } + ], + "domain": "0:0-0:27" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.block", + "languageId": "shellscript", + "facet": "value.iteration.block", + "code": "foo() { }", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:9" + } + ], + "domain": "0:0-0:9" + }, + { + "targets": [ + { + "content": "0:7-0:8" + } + ], + "domain": "0:7-0:8" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.block2", + "languageId": "shellscript", + "facet": "value.iteration.block", + "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.block3", + "languageId": "shellscript", + "facet": "value.iteration.block", + "code": "while true; do :; done", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:22" + } + ], + "domain": "0:0-0:22" + }, + { + "targets": [ + { + "content": "0:14-0:18" + } + ], + "domain": "0:14-0:18" + } + ] + }, + { + "name": "scopes/shellscript/value/value.iteration.document", + "languageId": "shellscript", + "facet": "value.iteration.document", + "code": "\ndeclare foo\n", + "scopes": [ + { + "targets": [ + { + "content": "0:0-2:0" + } + ], + "domain": "0:0-2:0" + } + ] + }, + { + "name": "scopes/shellscript/value/value.mapPair.iteration", + "languageId": "shellscript", + "facet": "value.mapPair.iteration", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:0-0:25" + } + ], + "domain": "0:0-0:25" + }, + { + "targets": [ + { + "content": "0:5-0:24" + } + ], + "domain": "0:5-0:24" + } + ] + }, + { + "name": "scopes/shellscript/value/value.mapPair", + "languageId": "shellscript", + "facet": "value.mapPair", + "code": "foo=([\"aaa\"]=0 [\"bbb\"]=1)", + "scopes": [ + { + "targets": [ + { + "content": "0:4-0:25", + "removal": "0:3-0:25" + } + ], + "domain": "0:0-0:25" + }, + { + "targets": [ + { + "content": "0:13-0:14", + "removal": "0:13-0:14" + } + ], + "domain": "0:5-0:14" + }, + { + "targets": [ + { + "content": "0:23-0:24", + "removal": "0:23-0:24" + } + ], + "domain": "0:15-0:24" + } + ] + }, + { + "name": "scopes/shellscript/value/value.return", + "languageId": "shellscript", + "facet": "value.return", + "code": "foo() {\n return 0;\n}", + "scopes": [ + { + "targets": [ + { + "content": "1:11-1:12", + "removal": "1:10-1:12" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/value/value.return2", + "languageId": "shellscript", + "facet": "value.return", + "code": "function foo {\n return 0;\n}", + "scopes": [ + { + "targets": [ + { + "content": "1:11-1:12", + "removal": "1:10-1:12" + } + ], + "domain": "1:4-1:12" + } + ] + }, + { + "name": "scopes/shellscript/value/value.switch", + "languageId": "shellscript", + "facet": "value.switch", + "code": "case $foo in esac", + "scopes": [ + { + "targets": [ + { + "content": "0:5-0:9", + "removal": "0:5-0:10" + } + ], + "domain": "0:0-0:17" + } + ] + }, + { + "name": "scopes/shellscript/value/value.variable", + "languageId": "shellscript", + "facet": "value.variable", + "code": "local foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:10-0:11", + "removal": "0:9-0:11" + } + ], + "domain": "0:0-0:11" + } + ] + }, + { + "name": "scopes/shellscript/value/value.variable2", + "languageId": "shellscript", + "facet": "value.variable", + "code": "declare foo=0", + "scopes": [ + { + "targets": [ + { + "content": "0:12-0:13", + "removal": "0:11-0:13" + } + ], + "domain": "0:0-0:13" + } + ] + }, { "name": "scopes/talon/value/value.assignment", "languageId": "talon", diff --git a/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx b/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx index 5f59b79d628..97459f7fac2 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx @@ -103,6 +103,12 @@ Default: `call` +##### Shell Script + + + + + ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx b/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx index e872a7732d9..ec58ebef2fd 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx @@ -103,6 +103,12 @@ Default: `callee` +##### Shell Script + + + + + ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx b/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx index 4e764215b5d..85578983c41 100644 --- a/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx @@ -95,6 +95,10 @@ Default: `if state` +##### Shell Script + + + ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/list.mdx b/packages/app-web-docs/src/docs/user/scopes/list.mdx index a12e4c84ba7..7542c4c56c9 100644 --- a/packages/app-web-docs/src/docs/user/scopes/list.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/list.mdx @@ -121,6 +121,10 @@ Default: `list` +##### Shell Script + + + ##### YAML diff --git a/packages/app-web-docs/src/docs/user/scopes/map.mdx b/packages/app-web-docs/src/docs/user/scopes/map.mdx index db56a00d71f..650e173dcb3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/map.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/map.mdx @@ -93,6 +93,10 @@ Default: `map` +##### Shell Script + + + ##### YAML diff --git a/packages/app-web-docs/src/docs/user/scopes/name.mdx b/packages/app-web-docs/src/docs/user/scopes/name.mdx index e5f630966dc..ab8d51f7c1a 100644 --- a/packages/app-web-docs/src/docs/user/scopes/name.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/name.mdx @@ -417,6 +417,10 @@ Default: `name` +##### Shell Script + + + ##### Talon @@ -469,6 +473,10 @@ Default: `name` +##### Shell Script + + + ### Name: Assignment destructuring Name (LHS) of an assignment statement using a destructuring pattern @@ -631,6 +639,10 @@ Default: `name` +##### Shell Script + + + ##### TypeScript @@ -919,6 +931,10 @@ Default: `name` +##### Shell Script + + + ##### Talon @@ -1025,6 +1041,12 @@ Default: `name` +##### Shell Script + + + + + ##### TypeScript @@ -1345,6 +1367,12 @@ Default: `name` +##### Shell Script + + + + + ##### Talon list @@ -1409,6 +1437,12 @@ Default: `name` +##### Shell Script + + + + + ##### TypeScript @@ -1555,6 +1589,14 @@ Default: `name` +##### Shell Script + + + + + + + ##### Talon @@ -1705,6 +1747,10 @@ Default: `name` +##### Shell Script + + + ##### Talon list diff --git a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx index 00536a1513e..fb8a5f4ba58 100644 --- a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx @@ -147,6 +147,14 @@ Default: `funk` +##### Shell Script + + + + + + + ##### TypeScript @@ -405,4 +413,8 @@ Default: `funk` +##### Shell Script + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx b/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx index ac6162dca57..ea65782ec6b 100644 --- a/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx @@ -39,4 +39,8 @@ Default: `regex` +##### Shell Script + + + diff --git a/packages/app-web-docs/src/docs/user/scopes/statement.mdx b/packages/app-web-docs/src/docs/user/scopes/statement.mdx index 8676b6883f6..0e0f847c59e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/statement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/statement.mdx @@ -89,6 +89,10 @@ Default: `state` +##### Shell Script + + + ##### Talon @@ -141,6 +145,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Assignment destructuring An assignment statement using a destructuring pattern @@ -217,6 +225,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Class A class/struct declaration @@ -343,6 +355,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Constructor A constructor declaration @@ -437,6 +453,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Do while A do-while loop @@ -637,6 +657,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Foreach A for-each loop @@ -699,6 +723,10 @@ Default: `state` +##### Shell Script + + + ##### Talon @@ -801,6 +829,12 @@ Default: `state` +##### Shell Script + + + + + ### Statement: Function call A function call statement @@ -865,6 +899,12 @@ Default: `state` +##### Shell Script + + + + + ##### Talon @@ -929,6 +969,10 @@ Default: `state` +##### Shell Script + + + ##### Talon @@ -981,6 +1025,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Interface An interface declaration @@ -1273,6 +1321,12 @@ Default: `state` +##### Shell Script + + + + + ### Statement: Static A static initialization block in a class, eg `static { ... }` @@ -1347,6 +1401,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Throw A throw statement @@ -1537,6 +1595,10 @@ Default: `state` +##### Shell Script + + + ### Statement: Variable destructuring A variable declaration using a destructuring pattern, eg `const { x, y } = point` @@ -1633,6 +1695,12 @@ Default: `state` +##### Shell Script + + + + + ##### Talon list @@ -1691,6 +1759,10 @@ Default: `state` +##### Shell Script + + + ### Statement: While A while loop @@ -1747,6 +1819,12 @@ Default: `state` +##### Shell Script + + + + + ### Statement: Yield A yield statement @@ -1913,6 +1991,14 @@ Default: `state` +##### Shell Script + + + + + + + ##### Talon @@ -2053,6 +2139,10 @@ Default: `state` +##### Shell Script + + + ##### Talon list diff --git a/packages/app-web-docs/src/docs/user/scopes/value.mdx b/packages/app-web-docs/src/docs/user/scopes/value.mdx index c6982bdcddc..f27bedbe681 100644 --- a/packages/app-web-docs/src/docs/user/scopes/value.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/value.mdx @@ -305,6 +305,10 @@ Default: `value` +##### Shell Script + + + ##### Talon @@ -361,6 +365,10 @@ Default: `value` +##### Shell Script + + + ### Value: Assignment destructuring Value (RHS) of an assignment statement using a destructuring pattern @@ -445,6 +453,10 @@ Default: `value` +##### Shell Script + + + ### Value: Field class Value (RHS) of a field declaration in a class/struct @@ -595,6 +607,10 @@ Default: `value` +##### Shell Script + + + ##### Talon @@ -659,6 +675,10 @@ Default: `value` +##### Shell Script + + + ##### Talon list @@ -749,6 +769,12 @@ Default: `value` +##### Shell Script + + + + + ### Value: Return lambda Implicit return value of an anonymous function @@ -861,6 +887,10 @@ Default: `value` +##### Shell Script + + + ### Value: Throw Value of a throw statement @@ -1033,6 +1063,12 @@ Default: `value` +##### Shell Script + + + + + ##### Talon list @@ -1235,6 +1271,14 @@ Default: `value` +##### Shell Script + + + + + + + ##### Talon @@ -1371,6 +1415,10 @@ Default: `value` +##### Shell Script + + + ##### Talon list @@ -1659,6 +1707,10 @@ Default: `value` +##### Shell Script + + + ##### Talon list diff --git a/packages/lib-common/src/references/languageReferences.ts b/packages/lib-common/src/references/languageReferences.ts index 38783b0608d..c8b6ad64be3 100644 --- a/packages/lib-common/src/references/languageReferences.ts +++ b/packages/lib-common/src/references/languageReferences.ts @@ -32,6 +32,7 @@ export type LanguageId = | "scala" | "scm" | "scss" + | "shellscript" | "talon" | "talon-list" | "typescript" @@ -127,6 +128,9 @@ export const languageReferences: Record = { scss: { name: "SCSS", }, + shellscript: { + name: "Shell Script", + }, talon: { name: "Talon", }, diff --git a/packages/lib-common/src/scopeSupportFacets/languageScopeSupport.ts b/packages/lib-common/src/scopeSupportFacets/languageScopeSupport.ts index 1b8dad136bf..fff865031c6 100644 --- a/packages/lib-common/src/scopeSupportFacets/languageScopeSupport.ts +++ b/packages/lib-common/src/scopeSupportFacets/languageScopeSupport.ts @@ -27,6 +27,7 @@ import { scalaScopeSupport } from "./scala"; import { scmScopeSupport } from "./scm"; import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { scssScopeSupport } from "./scss"; +import { shellscriptScopeSupport } from "./shellscript"; import { talonScopeSupport } from "./talon"; import { talonListScopeSupport } from "./talonList"; import { typescriptScopeSupport } from "./typescript"; @@ -68,6 +69,7 @@ export const languageScopeSupport: Record< scala: scalaScopeSupport, scm: scmScopeSupport, scss: scssScopeSupport, + shellscript: shellscriptScopeSupport, "talon-list": talonListScopeSupport, talon: talonScopeSupport, typescript: typescriptScopeSupport, From eedaf0a3d096082e9e63c9c1577d8d06aff983cd Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 17:50:41 +0200 Subject: [PATCH 21/26] more lint issues --- .../user/languages/fixtures/shellscript.json | 48 ------------------- .../src/docs/user/languages/shellscript.mdx | 6 --- .../src/docs/user/scopes/fixtures/name.json | 16 ------- .../docs/user/scopes/fixtures/statement.json | 16 ------- .../src/docs/user/scopes/fixtures/value.json | 16 ------- .../src/docs/user/scopes/name.mdx | 2 - .../src/docs/user/scopes/statement.mdx | 2 - .../src/docs/user/scopes/value.mdx | 2 - 8 files changed, 108 deletions(-) diff --git a/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json b/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json index 7c5fa150c08..84c192eda38 100644 --- a/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json +++ b/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json @@ -915,22 +915,6 @@ } ] }, - { - "name": "scopes/shellscript/name/name.iteration.block2", - "languageId": "shellscript", - "facet": "name.iteration.block", - "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", - "scopes": [ - { - "targets": [ - { - "content": "0:0-6:2" - } - ], - "domain": "0:0-6:2" - } - ] - }, { "name": "scopes/shellscript/name/name.iteration.block3", "languageId": "shellscript", @@ -1404,22 +1388,6 @@ } ] }, - { - "name": "scopes/shellscript/statement/statement.iteration.block2", - "languageId": "shellscript", - "facet": "statement.iteration.block", - "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", - "scopes": [ - { - "targets": [ - { - "content": "0:0-6:2" - } - ], - "domain": "0:0-6:2" - } - ] - }, { "name": "scopes/shellscript/statement/statement.iteration.block3", "languageId": "shellscript", @@ -1826,22 +1794,6 @@ } ] }, - { - "name": "scopes/shellscript/value/value.iteration.block2", - "languageId": "shellscript", - "facet": "value.iteration.block", - "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", - "scopes": [ - { - "targets": [ - { - "content": "0:0-6:2" - } - ], - "domain": "0:0-6:2" - } - ] - }, { "name": "scopes/shellscript/value/value.iteration.block3", "languageId": "shellscript", diff --git a/packages/app-web-docs/src/docs/user/languages/shellscript.mdx b/packages/app-web-docs/src/docs/user/languages/shellscript.mdx index cd883c91857..858238a82ab 100644 --- a/packages/app-web-docs/src/docs/user/languages/shellscript.mdx +++ b/packages/app-web-docs/src/docs/user/languages/shellscript.mdx @@ -265,8 +265,6 @@ Below are visualizations of all our scope tests for this language. These were cr - - #### 9. Name (iteration document) @@ -421,8 +419,6 @@ Below are visualizations of all our scope tests for this language. These were cr - - #### 19. Statement (iteration document) @@ -491,8 +487,6 @@ Below are visualizations of all our scope tests for this language. These were cr - - #### 10. Value (iteration document) diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json index 3dccbef93da..e2d0b04bd6d 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json @@ -12083,22 +12083,6 @@ } ] }, - { - "name": "scopes/shellscript/name/name.iteration.block2", - "languageId": "shellscript", - "facet": "name.iteration.block", - "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", - "scopes": [ - { - "targets": [ - { - "content": "0:0-6:2" - } - ], - "domain": "0:0-6:2" - } - ] - }, { "name": "scopes/shellscript/name/name.iteration.block3", "languageId": "shellscript", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json index 2c4e9a5e089..bb789d22a03 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json @@ -10873,22 +10873,6 @@ } ] }, - { - "name": "scopes/shellscript/statement/statement.iteration.block2", - "languageId": "shellscript", - "facet": "statement.iteration.block", - "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", - "scopes": [ - { - "targets": [ - { - "content": "0:0-6:2" - } - ], - "domain": "0:0-6:2" - } - ] - }, { "name": "scopes/shellscript/statement/statement.iteration.block3", "languageId": "shellscript", diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json index 83c6f4a12a8..c868b52dbc1 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json @@ -8636,22 +8636,6 @@ } ] }, - { - "name": "scopes/shellscript/value/value.iteration.block2", - "languageId": "shellscript", - "facet": "value.iteration.block", - "code": "if true; then\n :\nelif false; then\n :\nelse\n :\nfi", - "scopes": [ - { - "targets": [ - { - "content": "0:0-6:2" - } - ], - "domain": "0:0-6:2" - } - ] - }, { "name": "scopes/shellscript/value/value.iteration.block3", "languageId": "shellscript", diff --git a/packages/app-web-docs/src/docs/user/scopes/name.mdx b/packages/app-web-docs/src/docs/user/scopes/name.mdx index ab8d51f7c1a..1763ce01766 100644 --- a/packages/app-web-docs/src/docs/user/scopes/name.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/name.mdx @@ -1593,8 +1593,6 @@ Default: `name` - - ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/statement.mdx b/packages/app-web-docs/src/docs/user/scopes/statement.mdx index 0e0f847c59e..53340fc9d44 100644 --- a/packages/app-web-docs/src/docs/user/scopes/statement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/statement.mdx @@ -1995,8 +1995,6 @@ Default: `state` - - ##### Talon diff --git a/packages/app-web-docs/src/docs/user/scopes/value.mdx b/packages/app-web-docs/src/docs/user/scopes/value.mdx index f27bedbe681..e5d2ff37784 100644 --- a/packages/app-web-docs/src/docs/user/scopes/value.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/value.mdx @@ -1275,8 +1275,6 @@ Default: `value` - - ##### Talon From b53084df61cab228ea6c009ed3e8ecbb7249a5a2 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 17:53:35 +0200 Subject: [PATCH 22/26] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7392ffa70..21494681271 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2026 +- 2026-09-09: Added support for Shell script language. ([#2058](https://github.com/cursorless-dev/cursorless/pull/2058)) - 2026-09-02: Added documentation for learning resources. ([#3334](https://github.com/cursorless-dev/cursorless/pull/3334)) - 2026-09-02: Added reference documentation for community draft editor. ([#3333](https://github.com/cursorless-dev/cursorless/pull/3333)) - 2026-09-02: Added reference documentation for community alphabet and symbols. ([#3332](https://github.com/cursorless-dev/cursorless/pull/3332)) From 73fda37871dfb116f56c14c39e110059bd924b42 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 18:01:20 +0200 Subject: [PATCH 23/26] Clean up --- resources/queries/shellscript.scm | 38 +++++++------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 03e7d7465bb..69ad28b771b 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -262,40 +262,23 @@ (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy " " " \\\n") ) -;;!! function foo() { +;;!! function foo() {} ;;! ^^^ -;;! ---------------- -;;!! echo "foo" -;;! ---------- -;;!! } -;;! - (function_definition name: (_) @name -) @_.domain +) @name.domain -;; FIXME: Need to support redirections ;; interior: -;;!! function foo() { -;;! ---------------- -;;!! echo "foo" -;;! ^^^^^^^^^^ -;;! ---------- -;;!! } -;;! - +;;!! function foo() { } +;;! ^ (function_definition body: (_ (_)? @interior ) -) @namedFunction @_.domain - -;; -;; Names, values, and types -;; +) @namedFunction @interior.domain ;;!! for ((i = 1; i <= 5; i++)); do ;;! ^ -;;! xxxx -;;! ----- ( (variable_assignment name: (_) @name @value.leading.endOf @@ -306,29 +289,24 @@ ;;!! local foo="bar" ;;! ^^^ -;;! xxxxxxxxxx -;;! --------------- (declaration_command (variable_assignment name: (_) @name value: (_) @_.removal.end.startOf ) -) @_.domain @_.removal.start.startOf +) @name.domain @_.removal.start.startOf ;;!! local foo="bar" ;;! ^^^ -;;! xxxxxxxxxx -;;! --------------- (declaration_command (variable_assignment name: (_) @_.leading.endOf value: (_) @value ) -) @_.domain +) @value.domain ;;!! local foo ;;! ^^^ -;;! --------- (declaration_command (variable_name) @name -) @_.domain +) @name.domain From 07ec3162eaecb8d0c7635479ddd4ac20ea669bbc Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 18:05:48 +0200 Subject: [PATCH 24/26] Bug fixes --- resources/queries/shellscript.scm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 69ad28b771b..5806a154f80 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -219,7 +219,7 @@ ;;! ^^^^^ (string . - (string_content) @textFragment.start + (string_content)? @textFragment.start (string_content)? @textFragment.end . ) @string @@ -266,16 +266,7 @@ ;;! ^^^ (function_definition name: (_) @name -) @name.domain - -;; interior: -;;!! function foo() { } -;;! ^ -(function_definition - body: (_ - (_)? @interior - ) -) @namedFunction @interior.domain +) @namedFunction @name.domain ;;!! for ((i = 1; i <= 5; i++)); do ;;! ^ From e1de69cc8e3641e30cbbadbdfa2a71d38677d36a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 18:11:46 +0200 Subject: [PATCH 25/26] More fixes --- .../shellscript/statement/statement.if2.scope | 95 +++++++++++++++++++ resources/queries/shellscript.scm | 18 ++++ 2 files changed, 113 insertions(+) create mode 100644 resources/fixtures/scopes/shellscript/statement/statement.if2.scope diff --git a/resources/fixtures/scopes/shellscript/statement/statement.if2.scope b/resources/fixtures/scopes/shellscript/statement/statement.if2.scope new file mode 100644 index 00000000000..cd6e9454dbc --- /dev/null +++ b/resources/fixtures/scopes/shellscript/statement/statement.if2.scope @@ -0,0 +1,95 @@ +if foo; then + aaa + bbb +elif baz; then + ccc + ddd +fi +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-6:2 + >------------ +0| if foo; then +1| aaa +2| bbb +3| elif baz; then +4| ccc +5| ddd +6| fi + --< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:7 + >---< +1| aaa + +[#2 Removal] = 1:0-2:0 + >------- +1| aaa +2| bbb + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| aaa + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:7 + >---< +2| bbb + +[#3 Removal] = 2:0-3:0 + >------- +2| bbb +3| elif baz; then + < + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| bbb + +[#3 Insertion delimiter] = "\n" + + +[#4 Content] = +[#4 Domain] = 4:4-4:7 + >---< +4| ccc + +[#4 Removal] = 4:0-5:0 + >------- +4| ccc +5| ddd + < + +[#4 Leading delimiter] = 4:0-4:4 + >----< +4| ccc + +[#4 Insertion delimiter] = "\n" + + +[#5 Content] = +[#5 Domain] = 5:4-5:7 + >---< +5| ddd + +[#5 Removal] = 5:0-6:0 + >------- +5| ddd +6| fi + < + +[#5 Leading delimiter] = 5:0-5:4 + >----< +5| ddd + +[#5 Insertion delimiter] = "\n" diff --git a/resources/queries/shellscript.scm b/resources/queries/shellscript.scm index 5806a154f80..32d7dc91038 100644 --- a/resources/queries/shellscript.scm +++ b/resources/queries/shellscript.scm @@ -29,6 +29,24 @@ ) ) +;; Capture body statements without including commands before "then". +[ + (if_statement + "then" + [ + (command) + (variable_assignment) + ] @statement + ) + (elif_clause + "then" + [ + (command) + (variable_assignment) + ] @statement + ) +] + ( (program) @statement.iteration @namedFunction.iteration (#document-range! @statement.iteration @namedFunction.iteration) From dd0947cf1d551add7765ecffbf5726bb6f426471 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 9 Sep 2026 18:39:35 +0200 Subject: [PATCH 26/26] lint fix --- .../user/languages/fixtures/shellscript.json | 53 +++++++++++++++++++ .../src/docs/user/languages/shellscript.mdx | 2 + .../docs/user/scopes/fixtures/statement.json | 53 +++++++++++++++++++ .../src/docs/user/scopes/statement.mdx | 2 + 4 files changed, 110 insertions(+) diff --git a/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json b/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json index 84c192eda38..11871f06bdf 100644 --- a/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json +++ b/packages/app-web-docs/src/docs/user/languages/fixtures/shellscript.json @@ -1347,6 +1347,59 @@ } ] }, + { + "name": "scopes/shellscript/statement/statement.if2", + "languageId": "shellscript", + "facet": "statement.if", + "code": "if foo; then\n aaa\n bbb\nelif baz; then\n ccc\n ddd\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2", + "removal": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + }, + { + "targets": [ + { + "content": "1:4-1:7", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:7" + }, + { + "targets": [ + { + "content": "2:4-2:7", + "removal": "2:0-3:0" + } + ], + "domain": "2:4-2:7" + }, + { + "targets": [ + { + "content": "4:4-4:7", + "removal": "4:0-5:0" + } + ], + "domain": "4:4-4:7" + }, + { + "targets": [ + { + "content": "5:4-5:7", + "removal": "5:0-6:0" + } + ], + "domain": "5:4-5:7" + } + ] + }, { "name": "scopes/shellscript/statement/statement.import", "languageId": "shellscript", diff --git a/packages/app-web-docs/src/docs/user/languages/shellscript.mdx b/packages/app-web-docs/src/docs/user/languages/shellscript.mdx index 858238a82ab..6818b739e64 100644 --- a/packages/app-web-docs/src/docs/user/languages/shellscript.mdx +++ b/packages/app-web-docs/src/docs/user/languages/shellscript.mdx @@ -365,6 +365,8 @@ Below are visualizations of all our scope tests for this language. These were cr + + #### 11. Statement: Import An import statement diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json index bb789d22a03..fc80eec426c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json +++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json @@ -10832,6 +10832,59 @@ } ] }, + { + "name": "scopes/shellscript/statement/statement.if2", + "languageId": "shellscript", + "facet": "statement.if", + "code": "if foo; then\n aaa\n bbb\nelif baz; then\n ccc\n ddd\nfi", + "scopes": [ + { + "targets": [ + { + "content": "0:0-6:2", + "removal": "0:0-6:2" + } + ], + "domain": "0:0-6:2" + }, + { + "targets": [ + { + "content": "1:4-1:7", + "removal": "1:0-2:0" + } + ], + "domain": "1:4-1:7" + }, + { + "targets": [ + { + "content": "2:4-2:7", + "removal": "2:0-3:0" + } + ], + "domain": "2:4-2:7" + }, + { + "targets": [ + { + "content": "4:4-4:7", + "removal": "4:0-5:0" + } + ], + "domain": "4:4-4:7" + }, + { + "targets": [ + { + "content": "5:4-5:7", + "removal": "5:0-6:0" + } + ], + "domain": "5:4-5:7" + } + ] + }, { "name": "scopes/shellscript/statement/statement.import", "languageId": "shellscript", diff --git a/packages/app-web-docs/src/docs/user/scopes/statement.mdx b/packages/app-web-docs/src/docs/user/scopes/statement.mdx index 53340fc9d44..5ebbd68846a 100644 --- a/packages/app-web-docs/src/docs/user/scopes/statement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/statement.mdx @@ -973,6 +973,8 @@ Default: `state` + + ##### Talon