You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Autocomplete/Intellisense Does Not Show All Options For Object Value #30526
Autocomplete/intellisense is not showing all the options for an object that goes into a function parameter even though it is defined in a typescript interface.
Example:
interface Fruit {
/** Returns a fruit color. */
getFruitColor(options: { fruit: 'apple' | 'orange' }): string;
getFruitColor(options: { fruit: 'banana' }): boolean;
}
function testFunction (fruit: Fruit) {
let color = fruit.getFruitColor({ fruit: '' }); // <-- Autocomplete only shows apple and orange as options and not banana
}
It appears that only the first method's options object is getting indexed by VS autocomplete but not the second one.
Thanks the quick action. I would like to note, however, that other IDE's seem to be able to handle this situation, which is why I put it under the vscode github instead of typescript.
Activity
mjbvz commentedon Jul 12, 2017
This issue was moved to microsoft/TypeScript#17127
JonnyBoy333 commentedon Jul 12, 2017
Thanks the quick action. I would like to note, however, that other IDE's seem to be able to handle this situation, which is why I put it under the vscode github instead of typescript.
Example:

WebStorm