-
Notifications
You must be signed in to change notification settings - Fork 483
Snippets for dart-mode #277
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
Conversation
snippets/dart-mode/for
Outdated
| # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region nil)) | ||
| # -- | ||
| for(var i = ${1:0}; i ${2:< 10}; i${3:++}) { | ||
| ${4:Body} |
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.
could we not put $0 here instead of at the end of the for?
| # key: fori | ||
| # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region nil)) | ||
| # -- | ||
| for(var ${1:obj} in ${2:collection}) { |
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.
same thing here
snippets/dart-mode/func
Outdated
| @@ -0,0 +1,7 @@ | |||
| # -*- mode: snippet -*- | |||
| # name: func | |||
| # key: func | |||
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.
maybe fun or even just f is better?
snippets/dart-mode/funca
Outdated
| @@ -0,0 +1,7 @@ | |||
| # -*- mode: snippet -*- | |||
| # name: funca | |||
| # key: funca | |||
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.
considering it's an async function, maybe afun / af would seem more mnemonic to me, what do you think?
| # name: getset | ||
| # key: getset | ||
| # -- | ||
| ${1:Type} _${2:Name}; |
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.
is that such a common pattern to have it this way?
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.
Yes, getters are commonly used. This is generic pattern but it applies pretty well in this case.
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.
And if you mean '_Name' notation - '_' in Dart means 'private' in C like programming languages, so it has to be like that.
| # -*- mode: snippet -*- | ||
| # name: getter | ||
| # key: get | ||
| # -- |
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.
same question here
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.
Same here
|
Great thanks @l7ssha left a few comments and questions |
|
I've applied some of your notes @AndreaCrotti . Thanks for review. |
|
Great thanks |
Hello,
I've added few snippets for dart-mode. For now there no dart-mode snippets.