- VSCode Version: 1.41.0
- OS Version: macOS 10.14.6
Steps to Reproduce:
>> Playground Link
interface CustomElements {
'component-one': {
foo?: string;
},
'component-two': {
bar?: string;
}
}
interface Options<T extends keyof CustomElements> {
props: CustomElements[T];
}
function create<T extends keyof CustomElements>(name: T, options: Options<T>) {
return { name, options };
}
create('component-one', { props: { /* trigger intellisense here */ } });
const opts: Options<'component-one'> = {
props: { /* and here */ }
}
The type of props in the create call is correctly narrowed down to CustomElements['component-one'] by the type system, however Intellisense suggests the props of all fields of CustomElements:

This does not happen when creating an object of that type:

Does this issue occur when all extensions are disabled?: Yes