@@ -1195,7 +1195,7 @@ func (fs *osfsWithChmod) Chmod(name string, mode os.FileMode) error {
1195
1195
}
1196
1196
1197
1197
func findDevcontainerJSON (options Options ) (string , string ) {
1198
- // 0. Check provided options
1198
+ // 0. Check provided options.
1199
1199
if options .DevcontainerDir != "" || options .DevcontainerJSONPath != "" {
1200
1200
// Locate .devcontainer directory.
1201
1201
devcontainerDir := options .DevcontainerDir
@@ -1226,9 +1226,21 @@ func findDevcontainerJSON(options Options) (string, string) {
1226
1226
return devcontainerDir , devcontainerPath
1227
1227
}
1228
1228
1229
- // 1. Check `options.WorkspaceFolder`/.devcontainer/devcontainer.json
1230
- // 2. Check `options.WorkspaceFolder`/devcontainer.json
1231
- // 3. Check every folder: `options.WorkspaceFolder`/<folder>/devcontainer.json
1229
+ // 1. Check `options.WorkspaceFolder`/.devcontainer/devcontainer.json.
1230
+ location := filepath .Join (options .WorkspaceFolder , ".devcontainer" , "devcontainer.json" )
1231
+ _ , err := options .Filesystem .Stat (location )
1232
+ if err == nil {
1233
+ return filepath .Dir (location ), location
1234
+ }
1235
+
1236
+ // 2. Check `options.WorkspaceFolder`/devcontainer.json.
1237
+ location = filepath .Join (options .WorkspaceFolder , "devcontainer.json" )
1238
+ _ , err = options .Filesystem .Stat (location )
1239
+ if err == nil {
1240
+ return filepath .Dir (location ), location
1241
+ }
1242
+
1243
+ // 3. Check every folder: `options.WorkspaceFolder`/<folder>/devcontainer.json.
1232
1244
1233
1245
panic ("not implemented yet" )
1234
1246
}
0 commit comments