Fix for PT-167494938
Snippet completion was broken for concourse resource type 'extra insertions'.
This commit is contained in:
@@ -424,7 +424,7 @@ public class ConcourseModel {
|
||||
snippet.text("\n "+p.getName()+": ");
|
||||
snippet.placeHolder();
|
||||
}
|
||||
return snippet.toString();
|
||||
return snippet.build();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
|
||||
import org.eclipse.lsp4j.CompletionItem;
|
||||
import org.eclipse.lsp4j.Diagnostic;
|
||||
import org.eclipse.lsp4j.DiagnosticSeverity;
|
||||
import org.eclipse.lsp4j.InsertTextFormat;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
@@ -4382,6 +4383,24 @@ public class ConcourseEditorTest {
|
||||
);
|
||||
editor.assertProblems(/*NONE*/);
|
||||
}
|
||||
|
||||
@Test public void cfResourceTypeCompletion() throws Exception {
|
||||
Editor editor = harness.newEditor(
|
||||
"resources:\n" +
|
||||
"- name: foo\n" +
|
||||
" type: <*>"
|
||||
);
|
||||
CompletionItem item = editor.assertCompletionWithLabel(label -> label.startsWith("cf"),
|
||||
"resources:\n" +
|
||||
"- name: foo\n" +
|
||||
" type: cf\n" +
|
||||
" source:\n" +
|
||||
" api: $1\n" +
|
||||
" organization: $2\n" +
|
||||
" space: $3<*>"
|
||||
);
|
||||
assertEquals(InsertTextFormat.Snippet, item.getInsertTextFormat());
|
||||
}
|
||||
|
||||
@Test public void cfResourceSourceCompletions() throws Exception {
|
||||
Editor editor = harness.newEditor(
|
||||
|
||||
Reference in New Issue
Block a user