@@ -17,7 +17,8 @@ export enum LaunchTargetKind {
1717 Solution ,
1818 ProjectJson ,
1919 Folder ,
20- Csx
20+ Csx ,
21+ Cake
2122}
2223
2324/**
@@ -45,7 +46,7 @@ export function findLaunchTargets(): Thenable<LaunchTarget[]> {
4546 const options = Options . Read ( ) ;
4647
4748 return vscode . workspace . findFiles (
48- /*include*/ '{**/*.sln,**/*.csproj,**/project.json,**/*.csx}' ,
49+ /*include*/ '{**/*.sln,**/*.csproj,**/project.json,**/*.csx,**/*.cake }' ,
4950 /*exclude*/ '{**/node_modules/**,**/.git/**,**/bower_components/**}' ,
5051 /*maxResults*/ options . maxProjectResults )
5152 . then ( resources => {
@@ -74,7 +75,8 @@ function select(resources: vscode.Uri[], rootPath: string): LaunchTarget[] {
7475 hasSlnFile = false ,
7576 hasProjectJson = false ,
7677 hasProjectJsonAtRoot = false ,
77- hasCSX = false ;
78+ hasCSX = false ,
79+ hasCake = false ;
7880
7981 hasCsProjFiles = resources . some ( isCSharpProject ) ;
8082
@@ -111,6 +113,11 @@ function select(resources: vscode.Uri[], rootPath: string): LaunchTarget[] {
111113 if ( ! hasCSX && isCsx ( resource ) ) {
112114 hasCSX = true ;
113115 }
116+
117+ // Discover if there is any Cake file
118+ if ( ! hasCake && isCake ( resource ) ) {
119+ hasCake = true ;
120+ }
114121 } ) ;
115122
116123 // Add the root folder under the following circumstances:
@@ -137,6 +144,17 @@ function select(resources: vscode.Uri[], rootPath: string): LaunchTarget[] {
137144 } ) ;
138145 }
139146
147+ // if we noticed any Cake file(s), add a single Cake-specific target pointing at the root folder
148+ if ( hasCake ) {
149+ targets . push ( {
150+ label : "Cake" ,
151+ description : path . basename ( rootPath ) ,
152+ target : rootPath ,
153+ directory : rootPath ,
154+ kind : LaunchTargetKind . Cake
155+ } ) ;
156+ }
157+
140158 return targets . sort ( ( a , b ) => a . directory . localeCompare ( b . directory ) ) ;
141159}
142160
@@ -156,6 +174,10 @@ function isCsx(resource: vscode.Uri): boolean {
156174 return / \. c s x $ / i. test ( resource . fsPath ) ;
157175}
158176
177+ function isCake ( resource : vscode . Uri ) : boolean {
178+ return / \. c a k e $ / i. test ( resource . fsPath ) ;
179+ }
180+
159181export interface LaunchResult {
160182 process : ChildProcess ;
161183 command : string ;
0 commit comments