Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions YamlPipeline.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ contexts:
###[ POWERSHELL SCRIPT BLOCKS ]################################################

pwsh-block-node:
- meta_scope: meta.block.pwsh.pipeline
- meta_scope: meta.block.script.pipeline
- include: pwsh-block-scalar
- include: flow-scalar-pwsh-out

Expand Down Expand Up @@ -117,9 +117,10 @@ contexts:
- meta_include_prototype: false
- include: comment
- match: ^([ ]+)(?! ) # match first non-empty line to determine indentation level
scope: source.powershell.embedded
scope: meta.block.script.pipeline source.powershell.embedded
# note that we do not check if indentation is enough
embed: embedded-pwsh
embed_scope: meta.block.script.pipeline
escape: ^(?!\1|\s*$)
pop: 1
- match: ^(?=\S) # the block is empty
Expand All @@ -131,9 +132,10 @@ contexts:
- meta_include_prototype: false
- include: comment
- match: ^([ ]+)(?! ) # match first non-empty line to determine indentation level
scope: source.powershell.embedded
scope: meta.block.script.pipeline source.powershell.embedded
# note that we do not check if indentation is enough
embed: embedded-pwsh-folded
embed_scope: meta.block.script.pipeline
escape: ^(?!\1|\s*$)
pop: 1
- match: ^(?=\S) # the block is empty
Expand Down Expand Up @@ -195,9 +197,10 @@ contexts:
- meta_include_prototype: false
- include: comment
- match: ^([ ]+)(?! ) # match first non-empty line to determine indentation level
scope: source.shell.bash.embedded
scope: meta.block.script.pipeline source.shell.bash.embedded
# note that we do not check if indentation is enough
embed: embedded-bash
embed_scope: meta.block.script.pipeline
escape: ^(?!\1|\s*$)
pop: 1
- match: ^(?=\S) # the block is empty
Expand All @@ -209,9 +212,10 @@ contexts:
- meta_include_prototype: false
- include: comment
- match: ^([ ]+)(?! ) # match first non-empty line to determine indentation level
scope: source.shell.bash.embedded
scope: meta.block.script.pipeline source.shell.bash.embedded
# note that we do not check if indentation is enough
embed: embedded-bash-folded
embed_scope: meta.block.script.pipeline
escape: ^(?!\1|\s*$)
pop: 1
- match: ^(?=\S) # the block is empty
Expand Down
16 changes: 8 additions & 8 deletions tests/syntax_test_github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ jobs:
run: |
# <- meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml keyword.control.flow.script.pipeline
Write-Output Test
# <- source.powershell.embedded
#^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.powershell.embedded - source.powershell source.powershell
# <- meta.block.script.pipeline source.powershell.embedded
#^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block.script.pipeline source.powershell.embedded - source.powershell source.powershell
# ^^^^^^^^^^^^ support.function

- name: Test leading source.shell
run: |
# <- meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml keyword.control.flow.script.pipeline
echo Test
# <- source.shell.bash.embedded
#^^^^^^^^^^^^^^^^^^^ source.shell.bash.embedded - source.shell source.shell
# <- meta.block.script.pipeline source.shell.bash.embedded
#^^^^^^^^^^^^^^^^^^^ meta.block.script.pipeline source.shell.bash.embedded - source.shell source.shell
# ^^^^ support.function

# https://github.com/actions/checkout
Expand Down Expand Up @@ -151,8 +151,8 @@ jobs:
# ^ string.quoted.double.yaml punctuation.definition.string.end.yaml - meta.interpolation
run: |
if [[ "${{ matrix.sublime-build }}" == "latest" ]]; then
# <- source.yaml.pipeline.github-actions source.shell.bash.embedded - source.shell source.shell
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.yaml.pipeline.github-actions source.shell.bash.embedded - source.shell source.shell
# <- source.yaml.pipeline.github-actions meta.block.script.pipeline source.shell.bash.embedded - source.shell source.shell
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.yaml.pipeline.github-actions meta.block.script.pipeline source.shell.bash.embedded - source.shell source.shell
# ^^ punctuation.section.compound.begin, support.function.test.begin
# ^ punctuation.definition.string.begin
# ^^^ punctuation.section.interpolation.begin
Expand All @@ -173,8 +173,8 @@ jobs:
fi
tar xf st_syntax_tests.tar.xz
rm st_syntax_tests.tar.xz
# <- source.shell.bash.embedded - source.shell source.shell
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell.bash.embedded - source.shell source.shell
# <- meta.block.script.pipeline source.shell.bash.embedded - source.shell source.shell
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block.script.pipeline source.shell.bash.embedded - source.shell source.shell
# ^^ source.shell meta.function-call.identifier variable.function
- name: Run syntax tests
# ^ punctuation.definition.block.sequence.item - source.shell
Expand Down