Closed gimdongwoo closed 9 years ago
:+1: Great idea!!! Additionally if the controller file doesn't exist, open confirm dialog which makes new controller.
feel free to join my ti-create (https://github.com/m1ga/ti-create) package into yours! That would add the create part
@m1ga Great!!! Thanks
Now, you can add new go to definition
pattern easily.
I'll write about how to add that with more detail soon.
See below code https://github.com/yomybaby/atom-titanium/blob/master/lib/clickProvider.js#L54-L67
js : [
{
regExp : /Alloy\.createController\(["']$/,
targetPath : function(text,sourcePath){
return sourcePath.replace(/app\/(.*)$/,`app/controllers/${text}.js`)
}
},
{
regExp : /Alloy\.Collections.instance\(["']$/,
targetPath : function(text,sourcePath){
return sourcePath.replace(/app\/(.*)$/,`app/models/${text}.js`)
}
}
]
I think this. code for createContoller method, hyperclick to controller.js
example)
in this case, link for 'photoViewer' to open 'controllers/photoViewer.js'