You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Optional quick start from snippet/template in empty files #145929
When starting a new file, I want to have the option to pick from template, so that I don't have to start from scratch and google for a boilerplate to paste in.
It happened a few times like this in user testing. Participants create a file, discover the intuitive language quick pick that the placeholder offers and are delighted 😁. With a blank file in hand they then wander off to search engines to find boilerplate to test 🤨. Some languages suffer worse than others from impossible to remember boilerplate (HTML 😭). I never saw participants using snippets or emmet as the magic fast path to fill a file quickly.
How might we apply the placeholder text that allows picking a language to also picking a template:
Starting with an untitled buffer:
Create untitled buffer
Placeholder text offers to pick a language -> Quick pick HTML
Placeholder text offers to start from a template --> Quick pick html!!
🎉
From creating an empty file in the workspace:
Create new index.html file in Explorer and open it.
Placeholder text offers to start from a template --> Quick pick html!!
🎉
Snippets could be the existing system to provide those templates. They already have a prefix and description, which can be used in the quick pick. Their placeholders can also help to quickly name a component that is being created, set a title, etc.
changed the title [-]Optional quick start from snippet in empty files[/-][+]Optional quick start from snippet/template in empty files[/+]on Mar 31, 2022
I find that files that are out-of scope are also allowing for code snippets. I made a txt file for your example above and it still allowed me to paste it in.
I find that files that are out-of scope are also allowing for code snippets.
It will always show all "file snippets" but it will only update the language mode if the snippets defines one. The point of the feature is to populate the (empty) file with contents and set the corresponding language. That why there is no filtering
Activity
[-]Optional quick start from snippet in empty files[/-][+]Optional quick start from snippet/template in empty files[/+]digitarald commentedon Apr 1, 2022
Related user feedback: #145046 (comment)
15 remaining items
andreamah commentedon Jul 27, 2022
I find that files that are out-of scope are also allowing for code snippets. I made a txt file for your example above and it still allowed me to paste it in.

jrieken commentedon Aug 16, 2022
It will always show all "file snippets" but it will only update the language mode if the snippets defines one. The point of the feature is to populate the (empty) file with contents and set the corresponding language. That why there is no filtering
rzhao271 commentedon Aug 25, 2022
When I insert the JS snippet in a new empty file, the language changes to JS, but then auto-detection changes it back to CSS.
hinell commentedon Sep 6, 2022
Please, update documentation on this feature in the related documentation:
I also request to update every new snippet header file to: