imliam / vscode-inline-parameters

An extension for Visual Studio Code that adds inline parameter annotations when calling a function.

Home Page:https://marketplace.visualstudio.com/items?itemName=liamhammett.inline-parameters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functions with object parameters - Incorrect param name shown (TS)

cole-robertson opened this issue · comments

I have an example like:

const {component} = useTreeReducer({editing: {
    
  })

Where editing is the generated inline param name. The interface type for the function useTreeReducer is:

interface IProps {
editing?: boolean;
...
}

Specifically looks like it applies when syntax this style is used to defined a function:

const useTreeReducer = ({editing, ...}: IProps) => ...

I would expect that in this case inline params would not generate a name at all since the single parameter is just an unamed object. It seems to currently grab the first of the objects properties.