1
- component {
1
+ class {
2
2
3
3
variables.ignoreMethods = "init,$init,configure";
4
4
variables.outFile = "ColdBox.sublime-completions";
5
5
6
+ function main( args= [] ){
7
+ println( "********************************************" );
8
+ println( "Starting ColdBox Sublime Completions Generator..." );
9
+ println( "********************************************" );
10
+ // Run the generator
11
+ run();
12
+ println( "********************************************" );
13
+ println( "ColdBox Sublime Completions Generator Finished!" );
14
+ println( "********************************************" );
15
+ }
16
+
6
17
/**
7
18
* Generate the ColdBox Sublime Completions
8
19
*/
@@ -15,16 +26,15 @@ component {
15
26
" );
16
27
17
28
// Transpile Globals + Scopes
29
+ println( "√ Transpiling Global Scopes..." )
18
30
out.append( transpileGlobals() );
19
31
out.append( "," );
32
+ println( "√ Transpiling Normal Scopes..." )
20
33
out.append( transpileScopes() );
21
-
22
34
// Close it out
23
35
out.append( "]}" );
24
-
25
36
// Write it out
26
37
fileWrite( variables.outFile, out.toString() );
27
-
28
38
// Return data
29
39
return out.toString();
30
40
}
@@ -38,18 +48,19 @@ component {
38
48
"BaseSpec" : "testbox.system.BaseSpec"
39
49
}
40
50
// discover each components' function collection
41
- .map ( ( k , v ) = > getComponentMetadata ( v ).functions )
51
+ .map( ( k, v ) => getClassMetadata ( v ).functions )
42
52
// process each function set
43
- .map ( ( cfcName , functions ) = > {
53
+ .map( ( className, functions ) => {
54
+ println( "√ Transpiling [#className#]..." );
44
55
return functions
45
56
// Ignore reserved methods
46
57
.filter( ( thisFunction ) => !listFindNoCase( variables.ignoreMethods, thisFunction.name ) )
47
58
// Transpile function and parameters
48
59
.map( ( thisFunction ) => {
49
- var fwName = ( findNoCase ( " BaseSpec" , cfcName ) ? " TestBox" : " ColdBox" );
60
+ var fwName = ( findNoCase( "BaseSpec", className ) ? "TestBox" : "ColdBox" );
50
61
return
51
62
"{
52
- "" trigger"" : "" #this Function .name #\tfn. (#fwName #:#cfcName #)"" ,
63
+ ""trigger"": ""#thisFunction.name#\tfn. (#fwName#:#className #)"",
53
64
""contents"": ""#thisFunction.name#(#processParams( thisFunction.parameters )# )""
54
65
}";
55
66
})
@@ -63,7 +74,6 @@ component {
63
74
}, [] )
64
75
// Flatten it
65
76
.toList();
66
- ;
67
77
}
68
78
69
79
private function processParams( parameters ){
@@ -102,9 +112,10 @@ component {
102
112
"assert" : "testbox.system.Assertion"
103
113
}
104
114
// discover each components' function collection
105
- .map ( ( k , v ) = > getComponentMetadata ( v ).functions )
115
+ .map( ( k, v ) => getClassMetadata ( v ).functions )
106
116
// process each function set
107
117
.map( ( thisScope, functions ) => {
118
+ println( "√ Processing Scope [#thisScope#]..." );
108
119
return functions
109
120
// Ignore reserved methods
110
121
.filter( ( thisFunction ) => !listFindNoCase( variables.ignoreMethods, thisFunction.name ) )
0 commit comments