-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Optional quick start from snippet/template in empty files #145929
Comments
Related user feedback: #145046 (comment) |
@digitarald Let's discuss but the implementation has to wail till July |
|
With #155321 (a bigger PR with some other things as well) Screen.Recording.2022-07-15.at.18.06.28.movSnippets that have one or more scopes (set via the JSON-property or their file-name, in case of extensions) also set the document language. Snippets without scope (rare) don't affect the language @digitarald I believe we should reconsider the |
Maybe |
I like |
* rename to `isFileTemplate` * add code snippet provider for file templates, fix setting model mode #145929
We went with |
To verify:
|
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 |
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. |
Please, update documentation on this feature in the related documentation: I also request to update every new snippet header file to: // ...
// "Print to console": {
// "scope": "javascript,typescript",
// "isTopLevel": true,
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// } |
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:
HTML
html!!
From creating an empty file in the workspace:
index.html
file in Explorer and open it.html!!
Snippets could be the existing system to provide those templates. They already have a
prefix
anddescription
, 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.cc @stevencl @sana-ajani
Ideas:
The text was updated successfully, but these errors were encountered: