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

Add a VS Code snippet config for creating new BCD files. #2939

Merged
merged 2 commits into from
Oct 29, 2018

Conversation

connorshea
Copy link
Contributor

@connorshea connorshea commented Oct 8, 2018

I'm not sure if this is particularly useful, but I figured I'd try it anyway :) This makes it really easy to create a new BCD file. It'll show up whenever you type bcd in a JSON file in this repository.

NOTE: You'll need v1.28 (just came out today) for this, otherwise project-level snippets won't work.

Here's an example video

I created this with help from https://snippet-generator.app

VS Code docs: https://code.visualstudio.com/docs/editor/userdefinedsnippets

@connorshea
Copy link
Contributor Author

It may also be worth adding a snippet for a file with a subfeature, for convenience's sake.

@Elchi3 Elchi3 added enhancement Nice to have features. infra Infrastructure issues (npm, GitHub Actions, releases) of this project labels Oct 10, 2018
@connorshea
Copy link
Contributor Author

I used this when creating the hanging-punctuation PR (#2950), and I think it's worth noting that the snippet doesn't work quite right for CSS because it doesn't suggest the subcategories, e.g. properties, at-rules, selectors, types. The same is true of JavaScript. I'm not sure if there should be snippets for each type of BCD file or if this is fine as-is.

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @connorshea, I just tested it and it's a nice enhancement. It might not be perfect for every case, but it's a nice template to start from.
I have a suggestion for the status block, but otherwise this is good to go for me.

" \"status\": {",
" \"experimental\": ${4|true,false|},",
" \"standard_track\": ${5|true,false|},",
" \"deprecated\": ${6|true,false|}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this ${6|false,true|}" ?
If you don't tab through until here, it is set to true by default and deprecated: true isn't typical most of the time.

" }",
" },",
" \"status\": {",
" \"experimental\": ${4|true,false|},",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also suggest to make this false,true

@connorshea
Copy link
Contributor Author

@Elchi3 resolved 👍

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@Elchi3 Elchi3 merged commit 3e974b7 into mdn:master Oct 29, 2018
@connorshea connorshea deleted the add-snippet branch October 29, 2018 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Nice to have features. infra Infrastructure issues (npm, GitHub Actions, releases) of this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants