Remove unnessary param from getContextNode method

This commit is contained in:
Kris De Volder
2016-12-16 14:37:41 -08:00
parent e6c7ee2aaa
commit d867f71592
4 changed files with 23 additions and 7 deletions

View File

@@ -192,7 +192,7 @@ public abstract class ApplicationYamlAssistContext extends AbstractYamlAssistCon
List<TypedProperty> properties = getProperties(query, enumCaseMode, beanMode);
if (CollectionUtil.hasElements(properties)) {
ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(properties.size());
SNode contextNode = getContextNode(doc);
SNode contextNode = getContextNode();
Set<String> definedProps = getDefinedProperties(contextNode);
for (TypedProperty p : properties) {
String name = p.getName();
@@ -443,7 +443,7 @@ public abstract class ApplicationYamlAssistContext extends AbstractYamlAssistCon
YamlPath propertyPath = YamlPath.fromProperty(match.data.getId());
YamlPath relativePath = propertyPath.dropFirst(contextPath.size());
YamlPathSegment nextSegment = relativePath.getSegment(0);
SNode contextNode = getContextNode(file);
SNode contextNode = getContextNode();
//To determine if this completion is 'in place' or needs to be inserted
// elsewhere in the tree, we check whether a node already exists in our
// context. If it doesn't we can create it as any child of the context

View File

@@ -3298,6 +3298,22 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
" classpath:stuff/wordlist.txt<*>\n"
);
}
@Test public void testCompletionsInContextWithDuplicateKey() throws Exception {
//See: https://www.pivotaltracker.com/story/show/135708013
defaultTestData();
assertCompletions(
"spring:\n" +
" application:\n" +
" name: my-app\n" +
"spring:\n" +
" activemq:\n" +
" broker-u<*>"
, // ==>
"fill it in later"
);
}
@Test public void testClassReferenceCompletion() throws Exception {
CachingValueProvider.TIMEOUT = Duration.ofSeconds(20);