Handle completion edge cases with empty mapping nodes

This commit is contained in:
Josh Gross
2022-11-17 11:23:39 -08:00
committed by Christopher Schleiden
parent 92560f760d
commit 634cac8eb4
3 changed files with 65 additions and 18 deletions
+1 -9
View File
@@ -71,14 +71,13 @@ export async function complete(
}
}
const values = await getValues(token, parent, newPos, textDocument.uri, valueProviderConfig);
const values = await getValues(token, parent, textDocument.uri, valueProviderConfig);
return values.map(value => CompletionItem.create(value.label));
}
async function getValues(
token: TemplateToken | null,
parent: TemplateToken | null,
position: Position,
workflowUri: string,
valueProviderConfig: ValueProviderConfig | undefined
): Promise<Value[]> {
@@ -86,13 +85,6 @@ async function getValues(
return [];
}
if (token?.templateTokenType === TokenType.Null) {
// Ensure there's a space after the parent key
if (parent.range && position.character + 1 === parent.range.end[1]) {
return [];
}
}
const existingValues = getExistingValues(token, parent);
let customValues: Value[] | undefined = undefined;