Closed
Description
- VSCode Version: 1.22.2
- OS Version: macOS High Sierra 10.13.4
- Does this issue occur when all extensions are disabled?: Yes
I would like to propose support for the "useCodeSnippetsOnMethodSuggest" capability with React components. Given a TS definition like this
import React from 'react';
interface LabelProps {
text: string;
onClick(): void;
color?: string;
}
declare class Label extends React.Component<LabelProps, any> {}
export default Label;
I would like to be able to import Label into another component, type <Label
and press TAB, like you can for regular JS functions, and have it enter a snippet with all required props (i.e. not optional) prefilled and tab stops for each value
Example:
<Label text="$1" isDisabled={$2} $0 />
$1 - first tab stop. Surrounded by quotes because it is a string
$2 - second tab stop. Surrounded by braces because it is a function
$0 - final stop, for entering optional parameters
What are your thoughts?