Goto symbol for Variables

This commit is contained in:
Kris De Volder
2017-07-17 15:39:45 -07:00
parent ecdd8dc377
commit 53ca2f5642
2 changed files with 14 additions and 5 deletions

View File

@@ -71,6 +71,7 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
private YType t_instance_group_name_def;
private YType t_stemcell_alias_name_def;
private YType t_release_name_def;
private YType t_var_name_def;
public BoshDeploymentManifestSchema() {
TYPE_UTIL = f.TYPE_UTIL;
@@ -109,12 +110,12 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
t_instance_group_name_def = f.yatomic("InstanceGroupName")
.parseWith(ValueParsers.NE_STRING);
t_stemcell_alias_name_def = f.yatomic("StemcellAliasName")
.parseWith(ValueParsers.NE_STRING);
t_release_name_def = f.yatomic("ReleaseName")
.parseWith(ValueParsers.NE_STRING);
t_var_name_def = f.yatomic("VariableName")
.parseWith(ValueParsers.NE_STRING);
YAtomicType t_ip_address = f.yatomic("IPAddress"); //TODO: some kind of checking?
t_ip_address.parseWith(ValueParsers.NE_STRING);
@@ -217,7 +218,7 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
addProp(v2Schema, "properties", t_params).isDeprecated("Deprecated in favor of job level properties and links");
YBeanType t_variable = f.ybean("Variable");
addProp(t_variable, "name", t_ne_string).isPrimary(true);
addProp(t_variable, "name", t_var_name_def).isPrimary(true);
addProp(t_variable, "type", f.yenum("VariableType", "certificate", "password", "rsa", "ssh")).isRequired(true);
addProp(t_variable, "options", t_params);
addProp(v2Schema, "variables", f.yseq(t_variable));
@@ -266,7 +267,8 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
definitionTypes = ImmutableList.of(
t_instance_group_name_def,
t_stemcell_alias_name_def,
t_release_name_def
t_release_name_def,
t_var_name_def
);
}
return definitionTypes;

View File

@@ -647,6 +647,11 @@ public class BoshEditorTest {
@Test public void documentSymbols() throws Exception {
Editor editor = harness.newEditor(
"name: foo\n" +
"variables:\n" +
"- name: blobstore_admin_users_password\n" +
" type: password\n" +
"- name: blobstore_secure_link_secret\n" +
" type: password\n" +
"stemcells:\n" +
"- alias: default\n" +
" os: ubuntu-trusty\n" +
@@ -671,7 +676,9 @@ public class BoshEditorTest {
"foo-group|InstanceGroup",
"bar-group|InstanceGroup",
"one-release|Release",
"other-release|Release"
"other-release|Release",
"blobstore_admin_users_password|Variable",
"blobstore_secure_link_secret|Variable"
);
}
}