Handle completion edge cases with empty mapping nodes
This commit is contained in:
committed by
Christopher Schleiden
parent
92560f760d
commit
634cac8eb4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user