When using a union type as a parameter of a function in Monaco Editor, the suggestions do not appear. However, in VS Code, the suggestions are provided. Is there a setting I need to enable in Monaco to have the same functionality?
Although Monaco provides correct checking and errors, the suggestions seem to be missing.
Does anyone have any insights or solutions? Or is this feature not supported in Monaco Editor?
Check out the examples below:
type Test = {
choice1: "A" | "B" | "C";
choice2: "X" | "Y" | "Z";
}
function test<T extends keyof Test>(t: T, s: Test[T]) {
}
test("choice1", "")
VS Code:
Monaco Editor:
I also tested with a simple union type with the same issue Simple in Monaco
type Test2 = "something" | "somethingelse"
function test2(t: Test2) {
}
test2("")