From b404705925aedbf0fdfb8a05250f1552c6948cda Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Mon, 31 Jul 2023 14:38:02 +0300 Subject: [PATCH] Scope and index names in Bitbucket pipelines --- Bitbucket Pipeline.sublime-syntax | 13 +++++++++++++ Index Labels.tmPreferences | 2 +- tests/syntax_test_bitbucket_pipeline.yml | 8 +++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Bitbucket Pipeline.sublime-syntax b/Bitbucket Pipeline.sublime-syntax index 0724312..5ff8903 100644 --- a/Bitbucket Pipeline.sublime-syntax +++ b/Bitbucket Pipeline.sublime-syntax @@ -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) @@ -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 diff --git a/Index Labels.tmPreferences b/Index Labels.tmPreferences index 6eac3cc..8ef403f 100644 --- a/Index Labels.tmPreferences +++ b/Index Labels.tmPreferences @@ -5,7 +5,7 @@ name Index Labels scope - source.yaml.pipeline.github-actions entity.name.label.github-actions, source.yaml.pipeline.gitlab entity.name.label.gitlab + source.yaml.pipeline.github-actions entity.name.label.github-actions, source.yaml.pipeline.gitlab entity.name.label.gitlab, entity.name.label.bitbucket settings showInSymbolList diff --git a/tests/syntax_test_bitbucket_pipeline.yml b/tests/syntax_test_bitbucket_pipeline.yml index 1fb2951..2327718 100644 --- a/tests/syntax_test_bitbucket_pipeline.yml +++ b/tests/syntax_test_bitbucket_pipeline.yml @@ -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