-
Notifications
You must be signed in to change notification settings - Fork 596
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 macro call in snippet #4378
Conversation
@orizi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 7 unresolved discussions (waiting on @clint419)
vscode-cairo/snippets/cairo.json
line 217 at r1 (raw file):
"body": ["assert!($1, '$2');"], "description": "Creates an simple test" },
I think - as it can work without - and in any case - "
instead of '
Suggestion:
"Creates an assertion with macro": {
"prefix": "assert",
"body": ["assert!($1);"],
"description": "Creates an simple test"
},
vscode-cairo/snippets/cairo.json
line 222 at r1 (raw file):
"body": ["assert_eq!($1, $2, '$3');"], "description": "Creates an simple test" },
I think - as it can work without - and in any case - "
instead of '
Suggestion:
"Creates an equality assertion with macro": {
"prefix": "assert",
"body": ["assert_eq!($1, $2);"],
"description": "Creates an simple test"
},
vscode-cairo/snippets/cairo.json
line 227 at r1 (raw file):
"body": ["panic!($1);"], "description": "Creates panic" },
Suggestion:
"Creates panic": {
"prefix": "panic",
"body": ["panic!(\"$1\");"],
"description": "Creates panic"
},
vscode-cairo/snippets/cairo.json
line 232 at r1 (raw file):
"body": ["format!('$1', $2);"], "description": "Creates a String using interpolation of expressions" },
and in all other direct formats styles - as only the string format arg is a must.
Suggestion:
"Creates a String using interpolation of expressions": {
"prefix": "format",
"body": ["format!("$1");"],
"description": "Creates a String using interpolation of expressions"
},
vscode-cairo/snippets/cairo.json
line 262 at r1 (raw file):
"body": ["selector!($1);"], "description": "Creates a selector" },
Suggestion:
"Creates a selector": {
"prefix": "selector",
"body": ["selector!(\"$1\");"],
"description": "Creates a selector"
},
vscode-cairo/snippets/cairo.json
line 267 at r1 (raw file):
"body": ["component!($1, $2);"], "description": "Creates a component" },
note this is not in statement context - so i'm not sure if this should behave differently.
Suggestion:
"Declares a component usage": {
"prefix": "component",
"body": ["component!(path: $1, storage: $2, event: $3);"],
"description": "Declares a component usage"
},
vscode-cairo/snippets/cairo.json
line 277 at r1 (raw file):
"body": ["get_dep_component_mut!($1, $2);"], "description": "Get a mutable component" }
Suggestion:
"Get a mutable component": {
"prefix": "get_dep_component_mut",
"body": ["get_dep_component_mut!(ref $1, $2);"],
"description": "Get a mutable component"
}
@orizi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 7 unresolved discussions (waiting on @orizi)
vscode-cairo/snippets/cairo.json
line 217 at r1 (raw file):
Previously, orizi wrote…
I think - as it can work without - and in any case -
"
instead of'
Done.
vscode-cairo/snippets/cairo.json
line 222 at r1 (raw file):
Previously, orizi wrote…
I think - as it can work without - and in any case -
"
instead of'
Done.
vscode-cairo/snippets/cairo.json
line 227 at r1 (raw file):
"body": ["panic!($1);"], "description": "Creates panic" },
Done.
vscode-cairo/snippets/cairo.json
line 232 at r1 (raw file):
Previously, orizi wrote…
and in all other direct formats styles - as only the string format arg is a must.
Done.
vscode-cairo/snippets/cairo.json
line 262 at r1 (raw file):
"body": ["selector!($1);"], "description": "Creates a selector" },
Done.
vscode-cairo/snippets/cairo.json
line 267 at r1 (raw file):
Previously, orizi wrote…
note this is not in statement context - so i'm not sure if this should behave differently.
Done.
vscode-cairo/snippets/cairo.json
line 277 at r1 (raw file):
"body": ["get_dep_component_mut!($1, $2);"], "description": "Get a mutable component" }
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @clint419)
This change is