in language-service/src/services/yamlCompletion.ts [591:645]
private getInsertTextForProperty(key: string, propertySchema: JSONSchema, addValue: boolean, separatorAfter: string): string {
const propertyText = this.getInsertTextForValue(key, '');
const resultText = propertyText + ':';
let value: string = null;
if (propertySchema) {
var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type;
if (!type) {
if (propertySchema.properties) {
type = 'object';
} else if (propertySchema.items) {
type = 'array';
} else if (propertySchema.hasOwnProperty("oneOf")) {
type = "oneOf";
} else if (propertySchema.hasOwnProperty("anyOf")) {
type = "anyOf";
} else if (propertySchema.hasOwnProperty("allOf")) {
type = "allOf";
}
}
switch (type) {
case 'boolean':
value = ' $1';
break;
case 'string':
value = ' $1';
break;
case 'object':
value = '\n\t';
break;
case 'array':
value = '\n\t- ';
break;
case 'number':
case 'integer':
value = ' ${1:0}';
break;
case 'null':
value = ' ${1:null}';
break;
case "oneOf":
case "anyOf":
case "allOf":
value = "";
break;
default:
return propertyText;
}
}
if (value === null) {
value = '$1';
}
return resultText + value + separatorAfter;
}