diff --git a/dev/src/codewind/connection/UserProjectCreator.ts b/dev/src/codewind/connection/UserProjectCreator.ts index 81956bd2..8d830b4d 100644 --- a/dev/src/codewind/connection/UserProjectCreator.ts +++ b/dev/src/codewind/connection/UserProjectCreator.ts @@ -169,7 +169,13 @@ namespace UserProjectCreator { let projectType: string = projectTypeRes.label; let language: string; - if (projectType !== OTHER_TYPE_OPTION) { + // If the project type selected has a language that it always is, use that language, else have the user select it + const typesWithCorrespondingLanguage = ProjectType.getRecognizedInternalTypes() + .map((type) => type.toString()) + // Remove generic type because it can be any language + .filter((type) => type !== OTHER_TYPE_OPTION); + + if (typesWithCorrespondingLanguage.includes(projectType)) { language = projectTypeRes.language; } else { diff --git a/dev/src/codewind/project/ProjectType.ts b/dev/src/codewind/project/ProjectType.ts index 64da9a16..cdc78745 100644 --- a/dev/src/codewind/project/ProjectType.ts +++ b/dev/src/codewind/project/ProjectType.ts @@ -120,6 +120,10 @@ export class ProjectType { } } + public static getRecognizedInternalTypes(): ProjectType.InternalTypes[] { + return Object.values(this.InternalTypes); + } + /* private static getUserFriendlyType(type: ProjectType.Types): string { // For docker projects, return the language