Merge pull request #20 from actions/jtamsut/auto-complete-for-mappings
Handle auto-completion for string and boolean mappings
This commit is contained in:
@@ -474,4 +474,15 @@ jobs:
|
|||||||
expect(result.filter(x => x.label === "concurrency").map(x => x.textEdit?.newText)).toEqual(["concurrency"]);
|
expect(result.filter(x => x.label === "concurrency").map(x => x.textEdit?.newText)).toEqual(["concurrency"]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("adds a new line and indentation for mapping keys", async () => {
|
||||||
|
const input = "concurrency: |";
|
||||||
|
|
||||||
|
const result = await complete(...getPositionFromCursor(input));
|
||||||
|
|
||||||
|
expect(result.filter(x => x.label === "cancel-in-progress").map(x => x.textEdit?.newText)).toEqual([
|
||||||
|
"\n cancel-in-progress: "
|
||||||
|
]);
|
||||||
|
expect(result.filter(x => x.label === "group").map(x => x.textEdit?.newText)).toEqual(["\n group: "]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ function mappingValues(
|
|||||||
// No special insertText in this case
|
// No special insertText in this case
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DefinitionType.String:
|
||||||
|
case DefinitionType.Boolean:
|
||||||
|
insertText = `\n${indentation}${key}: `;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
insertText = `${key}: `;
|
insertText = `${key}: `;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user