I have this code:
interface Config {
initialState?: any
openIndicator?: any
closeIndicator?: any
open?: () => void
close?: () => void
manualOpen?: () => void
manualClose?: () => void
}
function ABC(config: Config) {
}
when I start writing:
ABC({
// my pointer is here
})
I see these suggestions:
Why are they duplicating? close
is there two times, open
is there two times.
Why? Is this something not standard in my code? Or is it intentional? What's the benefit of duplicating the interface properties in the autocompletion of vs-code?
Notice that this happens only for the functions. This is because one of those options simply autocompletes the key name for you while the other one (the one with parenthesis) also adds a function body.