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

Create snippets from editor selection #26706

Closed
CookieJack opened this issue May 16, 2017 · 13 comments
Closed

Create snippets from editor selection #26706

CookieJack opened this issue May 16, 2017 · 13 comments
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code snippets
Milestone

Comments

@CookieJack
Copy link

In the edit mode, I think it would be better if user take right mouse button click to define a custom code snippet.

One of the situations would be like this:
The user can select multiple line of the code and click right mouse button, then popup a menu and select "convert to code snippet" or something else.

All in all, we want a simple and fast way to create custom code snippet

@CookieJack CookieJack changed the title Feature Request: code snippet Feature Request: advanced code snippet May 16, 2017
@CookieJack CookieJack changed the title Feature Request: advanced code snippet Feature Request: Enhanced code snippet May 16, 2017
@alexdima alexdima added the feature-request Request for new features or functionality label May 17, 2017
@alexdima
Copy link
Member

fyi @jrieken

@alexdima alexdima added this to the Backlog milestone May 17, 2017
@alexdima alexdima removed their assignment May 17, 2017
@jrieken jrieken self-assigned this May 17, 2017
@jrieken
Copy link
Member

jrieken commented May 17, 2017

I like, had similar ideas the other day

@CookieJack
Copy link
Author

CookieJack commented May 18, 2017

I was an iOS developer and now turned to be a web front end developer, so same idea came from Xcode using experience.

@joewinger
Copy link

Agreed. Would make snippets even more approachable and friendly. I never have enough time to sit down and define a code snippet (even though it's only a few lines), but I can definitely see myself converting some code I've typed a million times in to a snippet by clicking my mouse a few times.

@jrieken jrieken modified the milestones: July 2017, Backlog Jun 19, 2017
@jrieken jrieken changed the title Feature Request: Enhanced code snippet Create snippets from editor Jun 27, 2017
@jrieken jrieken changed the title Create snippets from editor Create snippets from editor selection Jun 27, 2017
@jrieken jrieken modified the milestones: July 2017, August 2017 Jul 21, 2017
@jrieken jrieken modified the milestone: August 2017 Aug 17, 2017
@jrieken
Copy link
Member

jrieken commented Jan 12, 2018

there actually exists an extension for this: https://marketplace.visualstudio.com/items?itemName=dafanasev.snippetier

@d-akara
Copy link

d-akara commented Jan 12, 2018

Another option is using this extension to create the snippet bodies. Allows you to go back later and add to existing snippets.

See command Lines AS JSON https://marketplace.visualstudio.com/items?itemName=dakara.transformer

@connorshea
Copy link
Contributor

This'd make VS Code much more powerful for me, I don't currently use snippets mostly due to lack of this functionality 🙏

I'll try the extensions recommended here, but I'd argue it'd be better if users were able to create their own easily without an extension.

@jrieken jrieken added the help wanted Issues identified as good community contribution opportunities label Jun 20, 2019
@jrieken jrieken added this to the Backlog milestone Oct 21, 2019
@JohnnyCrazy
Copy link
Contributor

@jrieken How is the status here, are you guys still interested in a solution inside of vscode or are the listed extensions the way to go? :)

@futuremotiondev
Copy link

I personally would love the right click > create snippet functionality. Definitely still interested in this solution.

@nfx
Copy link

nfx commented Oct 22, 2021

will it ever land?...

@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Dec 7, 2022
@VSCodeTriageBot
Copy link
Collaborator

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
@pricklywiggles
Copy link

Please do reconsider, this would make writing and using snippets a breeze.

@johncmolyneux
Copy link

I find it just plain daft that this doesn't exist. I have to manually create an XML file in order to create a snippet. Welcome to 1990!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code snippets
Projects
None yet
Development

No branches or pull requests