Fix small spacing issue in snippet generator
This commit is contained in:
@@ -141,7 +141,7 @@ public class SchemaBasedSnippetGenerator implements TypeBasedSnippetProvider {
|
||||
generateNestedSnippet(true, typeUtil.getDomainType(type), builder, indent, nestingLimit);
|
||||
} else { //Treat like atomic
|
||||
//ready to enter whatever on the same line
|
||||
builder.text(" ");
|
||||
builder.ensureSpace();
|
||||
builder.placeHolder();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.bosh;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.ide.vscode.bosh.snippets.SchemaBasedSnippetGenerator;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SnippetBuilder;
|
||||
@@ -30,7 +32,35 @@ public class SchemaBasedSnippetGeneratorTest {
|
||||
@Test
|
||||
public void toplevelSnippet() throws Exception {
|
||||
YType v2Schema = typeUtil.inferMoreSpecificType(schema.getTopLevelType(), DynamicSchemaContext.NULL);
|
||||
System.out.println(generator.getSnippets(v2Schema).iterator().next());
|
||||
assertEquals(
|
||||
"name: $1\n" +
|
||||
"releases:\n" +
|
||||
"- name: $2\n" +
|
||||
" version: $3\n" +
|
||||
"stemcells:\n" +
|
||||
"- alias: $4\n" +
|
||||
" version: $5\n" +
|
||||
"update:\n" +
|
||||
" canaries: $6\n" +
|
||||
" max_in_flight: $7\n" +
|
||||
" canary_watch_time: $8\n" +
|
||||
" update_watch_time: $9\n" +
|
||||
"instance_groups:\n" +
|
||||
"- name: $10\n" +
|
||||
" azs:\n" +
|
||||
" - $11\n" +
|
||||
" instances: $12\n" +
|
||||
" jobs:\n" +
|
||||
" - name: $13\n" +
|
||||
" release: $14\n" +
|
||||
" vm_type: $15\n" +
|
||||
" stemcell: $16\n" +
|
||||
" networks:\n" +
|
||||
" - name: $17"
|
||||
,
|
||||
generator.getSnippets(v2Schema).iterator().next().getSnippet()
|
||||
);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user