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 VS Code snippets for Bevy #247

Merged
merged 4 commits into from
Aug 9, 2024
Merged

Conversation

benfrankel
Copy link
Collaborator

Fixes #202.

Copy link
Member

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

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

Many of these could be postfix instead, but I have no strong feelings on that.
Does adding these preserve the original custom Rust snippets? I know that they can get overridden pretty easily if you're not careful. For reference, these are the builtin ones:

       "Arc::new": {
            "postfix": "arc",
            "body": "Arc::new(${receiver})",
            "requires": "std::sync::Arc",
            "description": "Put the expression into an `Arc`",
            "scope": "expr"
        },
        "Rc::new": {
            "postfix": "rc",
            "body": "Rc::new(${receiver})",
            "requires": "std::rc::Rc",
            "description": "Put the expression into an `Rc`",
            "scope": "expr"
        },
        "Box::pin": {
            "postfix": "pinbox",
            "body": "Box::pin(${receiver})",
            "requires": "std::boxed::Box",
            "description": "Put the expression into a pinned `Box`",
            "scope": "expr"
        },
        "Ok": {
            "postfix": "ok",
            "body": "Ok(${receiver})",
            "description": "Wrap the expression in a `Result::Ok`",
            "scope": "expr"
        },
        "Err": {
            "postfix": "err",
            "body": "Err(${receiver})",
            "description": "Wrap the expression in a `Result::Err`",
            "scope": "expr"
        },
        "Some": {
            "postfix": "some",
            "body": "Some(${receiver})",
            "description": "Wrap the expression in an `Option::Some`",
            "scope": "expr"
        }

.vscode/bevy.code-snippets Outdated Show resolved Hide resolved
.vscode/bevy.code-snippets Show resolved Hide resolved
.vscode/bevy.code-snippets Outdated Show resolved Hide resolved
.vscode/bevy.code-snippets Outdated Show resolved Hide resolved
.vscode/bevy.code-snippets Outdated Show resolved Hide resolved
.vscode/bevy.code-snippets Outdated Show resolved Hide resolved
.vscode/bevy.code-snippets Show resolved Hide resolved
@benfrankel benfrankel marked this pull request as draft August 9, 2024 09:30
@benfrankel benfrankel marked this pull request as ready for review August 9, 2024 22:10
@benfrankel benfrankel merged commit ea68850 into TheBevyFlock:main Aug 9, 2024
4 checks passed
@benfrankel benfrankel deleted the snippets branch August 9, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add VS Code snippets
2 participants