diff --git a/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/depth.md b/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/depth.md new file mode 100644 index 000000000..8852e81a9 --- /dev/null +++ b/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/depth.md @@ -0,0 +1,3 @@ +*Optional.* If a positive integer is given, *shallow* clone the +repository using the `--depth` option. Using this flag voids your warranty. +Some things will stop working unless we have the entire history. \ No newline at end of file diff --git a/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/disable_git_lfs.md b/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/disable_git_lfs.md new file mode 100644 index 000000000..283869244 --- /dev/null +++ b/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/disable_git_lfs.md @@ -0,0 +1 @@ +*Optional.* If `true`, will not fetch Git LFS files. \ No newline at end of file diff --git a/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/submodules.md b/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/submodules.md new file mode 100644 index 000000000..6c40d6a9b --- /dev/null +++ b/vscode-extensions/vscode-concourse/src/main/resources/desc/GitGetParams/submodules.md @@ -0,0 +1,3 @@ +*Optional.* If `none`, submodules will not be fetched. If specified as +a list of paths, only the given paths will be fetched. If not specified, +or if `all` is explicitly specified, all submodules are fetched. \ No newline at end of file diff --git a/vscode-extensions/vscode-concourse/src/test/java/org/springframework/ide/vscode/concourse/PipelineYamlEditorTest.java b/vscode-extensions/vscode-concourse/src/test/java/org/springframework/ide/vscode/concourse/PipelineYamlEditorTest.java index d0608e3d4..1e42b6218 100644 --- a/vscode-extensions/vscode-concourse/src/test/java/org/springframework/ide/vscode/concourse/PipelineYamlEditorTest.java +++ b/vscode-extensions/vscode-concourse/src/test/java/org/springframework/ide/vscode/concourse/PipelineYamlEditorTest.java @@ -17,6 +17,7 @@ import java.util.Arrays; import java.util.stream.Collectors; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.springframework.ide.vscode.commons.util.IOUtil; import org.springframework.ide.vscode.languageserver.testharness.Editor; @@ -815,6 +816,25 @@ public class PipelineYamlEditorTest { } @Test public void gitResourceGetParamsReconcile() throws Exception { + Editor editor = harness.newEditor( + "resources:\n" + + "- name: my-git\n" + + " type: git\n" + + "jobs:\n" + + "- name: do-stuff\n" + + " plan:\n" + + " - get: my-git\n" + + " params:\n" + + " depth: -1\n" + + " disable_git_lfs: not-bool\n" + + " submodules: none" + ); + editor.assertHoverContains("depth", "using the `--depth` option"); + editor.assertHoverContains("submodules", "If `none`, submodules will not be fetched"); + editor.assertHoverContains("disable_git_lfs", "will not fetch Git LFS files"); + } + + @Test public void gitResourceGetParamsHovers() throws Exception { Editor editor = harness.newEditor( "resources:\n" + "- name: my-git\n" + @@ -833,6 +853,55 @@ public class PipelineYamlEditorTest { ); } + @Ignore + @Test public void gitResourcePutParamsCompletions() throws Exception { + String context = + "resources:\n" + + "- name: my-git\n" + + " type: git\n" + + "jobs:\n" + + "- name: do-stuff\n" + + " plan:\n" + + " - put: my-git\n" + + " params:\n" + + " <*>"; + + assertContextualCompletions(context, + "<*>" + , // ===> + "repository: <*>" + , + "rebase: <*>" + , + "tag: <*>\n" + , + "only_tag: <*>" + , + "tag_prefix: <*>" + , + "force: <*>" + , + "annotate: <*>" + ); + assertContextualCompletions(context, + "rebase: <*>" + , // ===> + "rebase: false<*>", + "rebase: true<*>" + ); + assertContextualCompletions(context, + "only_tag: <*>" + , // ===> + "only_tag: false<*>", + "only_tag: true<*>" + ); + assertContextualCompletions(context, + "force: <*>" + , // ===> + "force: false<*>", + "force: true<*>" + ); + } @Test public void contentAssistJobNames() throws Exception {