Tentative implementation of dynamic vm_type CA and reconcile

It is functional but still need to address caching issues
This commit is contained in:
Kris De Volder
2017-07-19 08:59:56 -07:00
parent cecd98f7a5
commit 35a558be37
7 changed files with 105 additions and 20 deletions

View File

@@ -146,7 +146,7 @@ public class BoshDeploymentManifestSchema implements YamlSchema {
YAtomicType t_vm_extension = f.yatomic("VMExtension"); //TODO: resolve dynamically from 'cloud config' ? https://www.pivotaltracker.com/story/show/148703877
t_vm_extension.parseWith(ValueParsers.NE_STRING);
YAtomicType t_vm_type = f.yatomic("VMType"); //TODO: resolve dynamically from 'cloud config' ? https://www.pivotaltracker.com/story/show/148686169
YAtomicType t_vm_type = f.yenumFromDynamicValues("VMType", (dc) -> cloudConfigProvider.getCloudConfig(dc).getVMTypes());
t_vm_type.parseWith(ValueParsers.NE_STRING);
YAtomicType t_az = f.yatomic("AvailabilityZone"); //TODO: resolve dynamically from 'cloud config': https://www.pivotaltracker.com/story/show/148704481

View File

@@ -14,7 +14,6 @@ import static org.springframework.ide.vscode.languageserver.testharness.Editor.P
import org.junit.Before;
import org.junit.Test;
import org.springframework.ide.vscode.bosh.BoshLanguageServer;
import org.springframework.ide.vscode.commons.util.text.LanguageId;
import org.springframework.ide.vscode.commons.yaml.reconcile.YamlSchemaProblems;
import org.springframework.ide.vscode.languageserver.testharness.Editor;
@@ -828,4 +827,19 @@ public class BoshEditorTest {
);
}
@Test public void contentAssistVMtype() throws Exception {
Editor editor = harness.newEditor(
"name: foo\n" +
"instance_groups: \n" +
"- name: some-server\n" +
" stemcell: windoze\n" +
" vm_type: <*>"
);
editor.assertContextualCompletions(
"<*>"
, // ==>
"default<*>",
"large<*>"
);
}
}