Skip to content

Commit

Permalink
Folded
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed May 16, 2024
1 parent d8252d1 commit e1b508c
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 40 deletions.
15 changes: 6 additions & 9 deletions AzureDevops.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,11 @@ contexts:
push: possible-accessor

embedded-bash:
- meta_append: true
- match: ''
embed: scope:source.shell.bash.azure-devops
escape: (?!)
- meta_include_prototype: false
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.azure-devops

embedded-bash-folded:
- meta_append: true
- match: ''
push: scope:source.shell.bash.azure-devops
with_prototype:
- include: swallow-newlines
- meta_include_prototype: false
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.folded-azure-devops
10 changes: 10 additions & 0 deletions Bash (AzureDevops Folded).sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
scope: source.shell.bash.folded-azure-devops
version: 2
hidden: true

extends:
- Bash (AzureDevops).sublime-syntax
- Bash (Folded).sublime-syntax
11 changes: 11 additions & 0 deletions Bash (Folded).sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
scope: source.shell.bash.folded
version: 2
hidden: true

extends: Packages/ShellScript/Bash.sublime-syntax

contexts:
eol-pop: []
10 changes: 10 additions & 0 deletions Bash (Github Actions Folded).sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
scope: source.shell.bash.folded-github-actions
version: 2
hidden: true

extends:
- Bash (Github Actions).sublime-syntax
- Bash (Folded).sublime-syntax
13 changes: 4 additions & 9 deletions Github Actions.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,13 @@ contexts:

embedded-bash:
- meta_include_prototype: false
- meta_append: true
- match: ''
embed: scope:source.shell.bash.github-actions
escape: (?!)
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.github-actions

embedded-bash-folded:
- meta_include_prototype: false
- meta_append: true
- match: ''
push: scope:source.shell.bash.github-actions
with_prototype:
- include: swallow-newlines
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.folded-github-actions

expect-jobs:
- match: ^(\s*)([\w\-]+)\s*(:)(?=\s|$)
Expand Down
15 changes: 6 additions & 9 deletions Gitlab CICD.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@ contexts:
pop: 1

embedded-bash:
- meta_append: true
- match: ''
embed: scope:source.shell.bash
escape: (?!)
- meta_include_prototype: false
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash

embedded-bash-folded:
- meta_append: true
- match: ''
push: scope:source.shell.bash
with_prototype:
- include: swallow-newlines
- meta_include_prototype: false
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.folded
15 changes: 3 additions & 12 deletions YamlPipeline.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ contexts:
escape: '{{_flow_scalar_end_plain_out}}'
pop: 1

embedded-bash:
#- clear_scopes: 1
- meta_include_prototype: false

script-block-scalar-begin:
- meta_include_prototype: false
- include: comment
Expand Down Expand Up @@ -171,13 +167,8 @@ contexts:
scope: punctuation.definition.string.end.pipeline
pop: 1

embedded-bash-folded:
embedded-bash:
- meta_include_prototype: false

swallow-newlines:
- match: \n
push: swallowing-newline

swallowing-newline:
- match: ^
pop: 1
embedded-bash-folded:
- meta_include_prototype: false
18 changes: 18 additions & 0 deletions tests/syntax_test_github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,21 @@ jobs:
run: |
echo '# Some Markdown Content Here' >> $GITHUB_STEP_SUMMARY
# ^^^^^^^^^^^^^^^^^^^^ variable.language.github-actions

- name: folded shell script command
run: >-
mvn
--batch-mode
# ^^^^^^^^^^ source.shell meta.function-call.arguments meta.parameter.option variable.parameter.option
$MAVEN_CLI_OPTS_DEFAULT
$MAVEN_CLI_OPTS
$MAVEN_GITFLOW_CLI_OPTS
gitflow:release-finish
# ^^^^^^^^^^^^^^^^^^^^^ source.shell meta.function-call.arguments - variable
-DpushRemote=true
-DreleaseVersion="${NEW_VERSION}"
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell meta.function-call.arguments
# ^ keyword.operator.assignment
# ^^^^^^^^^^^^^^^^ meta.string
# ^^^^^^^^^^^ meta.interpolation.parameter variable.other.readwrite
-DskipTestProject=true
2 changes: 1 addition & 1 deletion tests/syntax_test_gitlab_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ release-finish:
-DreleaseVersion="${NEW_VERSION}"
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell meta.function-call.arguments
# ^ keyword.operator.assignment
# ^^^^^^^^^^^^^^^^^ meta.string
# ^^^^^^^^^^^^^^^^ meta.string
# ^^^^^^^^^^^ meta.interpolation.parameter variable.other.readwrite
-DskipTestProject=true

0 comments on commit e1b508c

Please sign in to comment.