Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React support for useCodeSnippetsOnMethodSuggest #48562

Closed
lifehackett opened this issue Apr 24, 2018 · 3 comments
Closed

React support for useCodeSnippetsOnMethodSuggest #48562

lifehackett opened this issue Apr 24, 2018 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@lifehackett
Copy link

  • 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?

@vscodebot vscodebot bot added the javascript JavaScript support issues label Apr 24, 2018
@mjbvz mjbvz added the feature-request Request for new features or functionality label Jun 21, 2018
@mjbvz mjbvz added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jun 25, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Jun 25, 2018

I like the idea. Requires some upstream work though: microsoft/TypeScript#25207

@chadgarlandscg
Copy link

This would be really amazing to have! It was the best part about Webstorm, but I vastly prefer using VS Code (it's so much faster!). @mjbvz Is there any ETA on this feature? 🙏

@mjbvz
Copy link
Collaborator

mjbvz commented Oct 3, 2020

Closing this in favor of the upstream issue: microsoft/TypeScript#25207

We will continue discussion there

@mjbvz mjbvz closed this as completed Oct 3, 2020
@mjbvz mjbvz added the upstream-issue-linked This is an upstream issue that has been reported upstream label Oct 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

3 participants