Skip to content

Commit

Permalink
Scope and index names in Bitbucket pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-hall committed Jul 31, 2023
1 parent 8489e72 commit b404705
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Bitbucket Pipeline.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ contexts:
1: string.unquoted.plain.out.yaml keyword.control.flow.script.pipeline
2: punctuation.separator.key-value.yaml
push: script-block-sequence
- match: ^\s+(name)\s*(:)\s*
captures:
1: meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml
2: punctuation.separator.key-value.yaml
push:
- meta-name


script-block-sequence:
- match: (-)[ \t]+(?=\S)
Expand All @@ -25,3 +32,9 @@ contexts:
escape: '{{_flow_scalar_end_plain_out}}'
- match: (?=\S)
pop: 1

meta-name:
- meta_content_scope: entity.name.label.bitbucket
- include: flow-scalar-12
- match: ''
pop: 1
2 changes: 1 addition & 1 deletion Index Labels.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>name</key>
<string>Index Labels</string>
<key>scope</key>
<string>source.yaml.pipeline.github-actions entity.name.label.github-actions, source.yaml.pipeline.gitlab entity.name.label.gitlab</string>
<string>source.yaml.pipeline.github-actions entity.name.label.github-actions, source.yaml.pipeline.gitlab entity.name.label.gitlab, entity.name.label.bitbucket</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
Expand Down
8 changes: 7 additions & 1 deletion tests/syntax_test_bitbucket_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# SYNTAX TEST "Packages/YamlPipelines/Bitbucket Pipeline.sublime-syntax"
# SYNTAX TEST partial-symbols "Packages/YamlPipelines/Bitbucket Pipeline.sublime-syntax"
image:
name: atlassian/default-image:2

pipelines:
# ^^^^^^^ meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml - entity
default:
- step:
name: Build and Push
# ^^^^ meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml
# ^ punctuation.separator.key-value.yaml
# ^^^^^^^^^^^^^^ entity.name.label.bitbucket meta.string.yaml string.unquoted.plain.in.yaml
# @@@@@@@@@@@@@@ definition
# ^ - entity - string
script:
# ^^^^^^ string.unquoted.plain.out keyword.control.flow.script
# ^ punctuation.separator.key-value
Expand Down

0 comments on commit b404705

Please sign in to comment.