-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pro fancy version for coffeeScript syntax #3
Changes from all commits
9172f1d
1a643cb
701598d
e27a991
ddd6f87
43e5053
1a64c7e
5a373e5
ec91b68
88fbc89
46dc455
3931788
26a7d82
d0af3ce
bd72e6c
a0e3e24
2969906
dea2d74
795669e
8a04713
4c92e37
9eafc48
347b55c
d3785a6
1a84b0c
f4ec93a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
'.source.coffee': | ||
|
||
|
||
|
||
|
||
'Ember Snippets: computed properties': | ||
'prefix': 'computed--help' | ||
'body': | ||
""" | ||
${1: | ||
# snippets to generate computed properties : | ||
# example: com.lt<press tab> | ||
# ____________________________________________________________________ | ||
# | type shorthand -> or long version -> press tab to genetate: | | ||
# | ------------ -> ------------ -> ------------------------- | | ||
# | com.lt -> computed.lt -> Ember.computed.lt(... | | ||
# | com.or -> computed.or -> Ember.computed.or(... | | ||
# | com.gt -> computed.gt -> Ember.computed.gt(... | | ||
# | com.and -> computed.and -> Ember.computed.and(... | | ||
# | com.max -> computed.max -> Ember.computed.max(... | | ||
# | com.min -> computed.min -> Ember.computed.min(... | | ||
# | com.map -> computed.map -> Ember.computed.map(... | | ||
# | com.mapB -> computed.mapB -> Ember.computed.mapBy(... | | ||
# | com.fil -> computed.fil -> Ember.computed.filter(... | | ||
# | com.filB -> computed.filB -> Ember.computed.filterBy(...| | ||
# | com.emp -> computed.emp -> Ember.computed.empty(... | | ||
# |____________________________________________________________________| | ||
# | ||
# *press <Backspace> to remove this quick guide. | ||
|
||
} | ||
""" | ||
|
||
'Ember computed greater than': | ||
'prefix': 'computed.gt' | ||
'body': "Ember.computed.gt('${1:property}', ${2:0}) ${3:# (returns a boolean)}" | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please remove all those empty lines, it's unnecessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed. |
||
|
||
|
||
'Ember computed less than': | ||
'prefix': 'computed.lt' | ||
'body': "Ember.computed.lt('${1:property}', ${2:0}) ${3:# (returns a boolean)}" | ||
|
||
|
||
|
||
|
||
'Ember computed alias or ': | ||
'prefix': 'computed.or' | ||
'body': "Ember.computed.or('${1:property_1}', '${2:property_2}') ${3:# (returns a boolean)}" | ||
|
||
|
||
|
||
|
||
'Ember computed alias and': | ||
'prefix': 'computed.and' | ||
'body': "Ember.computed.and('${1:property_1}', '${2:property_2}') ${3:# (returns a boolean)}" | ||
|
||
|
||
|
||
|
||
'Ember computed alias Max': | ||
'prefix': 'computed.max' | ||
'body': "Ember.computed.max('${1:property_1}') ${2:# (returns a number)}" | ||
|
||
|
||
|
||
|
||
'Ember computed alias Min': | ||
'prefix': 'computed.min' | ||
'body': "Ember.computed.min('${1:property_1}') ${2:# (returns a number)}" | ||
|
||
|
||
|
||
|
||
'Ember computed alias map': | ||
'prefix': 'computed.map' | ||
'body': " Ember.computed.map('${1:array_property}', (item, index) -> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you change quotations with multiline quotations |
||
${2:#example logic | ||
altered_item = item + "some_string" | ||
return altered_item } | ||
|
||
${3:# outputs a new array} | ||
" | ||
|
||
|
||
|
||
|
||
'Ember computed alias mapBy': | ||
'prefix': 'computed.mapBy' | ||
'body': " Ember.computed.mapBy('${1:array_of_objs}','${2:obj_key}') ${3:# outputs a simple array[] of items} " | ||
|
||
|
||
|
||
|
||
'Ember computed alias filter': | ||
'prefix': 'computed.filter' | ||
'body': | ||
""" | ||
Ember.computed.filter('${1:array_property}', ( item, index, array ) -> | ||
${2:#logic... | ||
# return true (or false) } | ||
""" | ||
|
||
|
||
|
||
|
||
'Ember computed alias filterBy': | ||
'prefix': 'computed.filterBy' | ||
'body': "Ember.computed.filterBy('${1:array_of_objs}','${2:obj_key}', ${3:value}) ${4:#returns filtered array[]}" | ||
|
||
|
||
|
||
|
||
'Ember computed alias empty': | ||
'prefix': 'computed.empty' | ||
'body': "Ember.computed.empty('${1:propery}') ${2:#returns boolean}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'.source.coffee': | ||
|
||
|
||
'available in model': | ||
'prefix': 'arrayController--help' | ||
'body': | ||
""" | ||
${1: | ||
# you can use these snippets in a arrayController function. | ||
# | ||
# DS.arrayController.extend( | ||
# example : iC<tab> | ||
# _______________________________________________________________ | ||
# | type shorthand -> or long version -> press tab to see: | | ||
# | ----------- -> ------------- -> ------------------ | | ||
# | iC -> itemController -> itemController... | | ||
# | sP -> sortProperties -> sortProperties... | | ||
# | sA -> sortAscending -> sortAscending... | | ||
# |_______________________________________________________________| | ||
# ) | ||
# *press <Backspace> to remove this quick guide. | ||
|
||
} | ||
""" | ||
|
||
|
||
'Ember Object Controller': | ||
'prefix': 'objectController' | ||
'body': | ||
""" | ||
_export = Ember.ObjectController.extend( | ||
${1:#body} | ||
) | ||
""" | ||
|
||
|
||
|
||
|
||
'Ember Array Controller': | ||
'prefix': 'arrayController' | ||
'body': | ||
""" | ||
_export = Ember.ArrayController.extend( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is way complicated. Can we simplify this, to make it just the bare minimum. It should only contain body There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I just had forgotten to delete them. |
||
${4:actions: | ||
${5:name_1}: -> | ||
${6:#logic...} | ||
} | ||
) | ||
|
||
""" | ||
|
||
'itemController': | ||
'prefix': 'itemController' | ||
'body': "itemController : '${1:an_objController}'}" | ||
|
||
'sortProperties': | ||
'prefix': 'sortProperties' | ||
'body': "sortProperties : ['${1:property}']}" | ||
|
||
'sortAscending': | ||
'prefix': 'sortAscending' | ||
'body': "sortAscending : ['${1:false}']}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'.source.coffee': | ||
|
||
'Ember Snippets for es6 syntax': | ||
'prefix': 'es6--help' | ||
'body': | ||
""" | ||
${1: | ||
# snippets to generate --ES6 syntax-- | ||
# example: imp-ds<press tab> | ||
# ___________________________________________________________ | ||
# | type short (or) long version -> then press <tab> | | ||
# | ---------- -> --------------- -> ----------------------| | ||
# | imp-ds -> import-ds -> `import DS... ` | | ||
# | imp-emb -> import-ember -> `import Ember... ` | | ||
# | exp-def -> export-default -> `export default... ` | | ||
# | es6 -> es6 -> - full set - | | ||
# |___________________________________________________________| | ||
} | ||
""" | ||
|
||
'ES6 import Ember': | ||
'prefix': 'import-ember' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just have this as part of generating There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are meant to be used in case of when the user forgets or suspects what to type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep in mind that the package is written to primarily work with the long version. /even the zen-coding (or emmet) has such ugly optional shorthands in it./ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not following. I was talking about having an import snippets, why not just have Why write import, and the route, why not just have it generate import and save you from the hassle There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahaa, |
||
'body': | ||
""" | ||
`import Ember from "ember";` | ||
${1} | ||
""" | ||
|
||
|
||
|
||
|
||
'ES6 import DS': | ||
'prefix': 'import-ds' | ||
'body': | ||
""" | ||
`import DS from 'ember-data';` | ||
${1} | ||
""" | ||
|
||
|
||
|
||
|
||
'ES6 export syntax': | ||
'prefix': 'export-default' | ||
'body': | ||
""" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Way too much spacing . Also i don't see this necessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good note. |
||
|
||
${2} | ||
|
||
|
||
|
||
`export default ${1:_export};` | ||
""" | ||
|
||
|
||
|
||
|
||
'ES6 import and export': | ||
'prefix': 'es6' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the point in that either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only because white space allows the content to breath, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I meant, having There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. es6 is meant to be used in a blank new file at the start. |
||
'body': | ||
""" | ||
${1:`import Ember from 'ember';`} | ||
${2:`import DS from 'ember-data';`} | ||
|
||
|
||
|
||
${3} | ||
|
||
|
||
|
||
`export default _export;` | ||
|
||
""" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'.source.coffee': | ||
|
||
'Ember Snippets: logging functions': | ||
'prefix': 'logger--help' | ||
'body': | ||
""" | ||
${1: | ||
# snippets for Ember.Logger class : | ||
# example : log.err<tab> | ||
# _______________________________________________________________ | ||
# | type these -> or long version -> press tab to generate: | | ||
# | ----------- -> -------------- -> ------------------------ | | ||
# | log.err -> logger.error -> Ember.Logger.error(... | | ||
# | log.deb -> logger.debug -> Ember.Logger.debug(... | | ||
# | log.log -> logger.log -> Ember.Logger.log(... | | ||
# | log.inf -> logger.info -> Ember.Logger.info(... | | ||
# | log.war -> logger.warn -> Ember.Logger.warn(... | | ||
# |_______________________________________________________________| | ||
# | ||
# *press <Backspace> to remove this quick guide. | ||
|
||
} | ||
""" | ||
|
||
'Ember Logger Debug': | ||
'prefix': 'logger.debug' | ||
'body': "Ember.Logger.debug('${1:message}')" | ||
|
||
|
||
|
||
'Ember Logger Log': | ||
'prefix': 'logger.log' | ||
'body': "Ember.Logger.log('${1:message}')" | ||
|
||
|
||
|
||
'Ember Logger Info': | ||
'prefix': 'logger.info' | ||
'body': "Ember.Logger.info('${1:message}')" | ||
|
||
|
||
|
||
'Ember Logger Warn': | ||
'prefix': 'logger.warn' | ||
'body': "Ember.Logger.warn('${1:message}')" | ||
|
||
|
||
|
||
'Ember Logger Error': | ||
'prefix': 'logger.error' | ||
'body': "Ember.Logger.error('${1:message}')" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
'.source.coffee': | ||
|
||
|
||
'available in model': | ||
'prefix': 'model--help' | ||
'body': | ||
""" | ||
${1: | ||
# you can use these snippets in a Model function. | ||
# | ||
# DS.Model.extend( | ||
# example : att<tab> | ||
# __________________________________________________________ | ||
# | type shorthand -> or long version -> press tab to see: | | ||
# | ----------- -> ------------- -> ------------------ | | ||
# | att -> attr -> DS.attr(... | | ||
# | bel -> belongsTo -> DS.belongsTo(... | | ||
# | has -> hasMany -> DS.hasMany(... | | ||
# |___________________________________________________________| | ||
# ) | ||
# *press <Backspace> to remove this quick guide. | ||
} | ||
""" | ||
|
||
|
||
|
||
|
||
'Ember Model': | ||
'prefix': 'model' | ||
'body': | ||
""" | ||
_export = DS.Model.extend( | ||
${1:# see more snippets by Expanding : | ||
|
||
# model--help${2} | ||
# or model-h for short. | ||
} | ||
) | ||
""" | ||
|
||
|
||
|
||
|
||
'Ember Model attributes': | ||
'prefix': 'attr' | ||
'body': "${1}: DS.attr( 'string' ) # or 'number' , 'boolean' , 'date'" | ||
|
||
|
||
|
||
|
||
'Ember Model Relation: belongsTo ': | ||
'prefix': 'belongsTo' | ||
'body': "${1} : DS.belongsTo('${2:other_Model}',async: ${3:false})" | ||
|
||
|
||
|
||
|
||
'Ember Model Relation: hasMany': | ||
'prefix': 'hasMany' | ||
'body': "${1} : DS.hasMany('${2:other_Model}',async: ${3:false})" |
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.
I find it unnecessary to have help. The way i see that, snippets shouldn't have that. It should just work by knowledge you already have in mind. If you have to look it up, it will waste time. Can you explain why it's important?
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.
They are written to be used with the knowledge we have already in mind.
But however we as human nonetheless Sometimes Forget.
these help files are just for a quick recap for when we forget or suspect.
Not to be used each time.
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.
I just feel they would be hard to maintain, and I don't think it's necessary. I'm so-so on the issue, If you feel that it would be important then lets keep them.