Skip to content

Commit 2235751

Browse files
Add PHP and other project types to type detection
Also added Python (pyproject.toml), Elixir, Dart/Flutter, C/C++. PHP fallback: scan root dir for .php files if no composer.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2c7f3a4 commit 2235751

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeep",
3-
"version": "1.2.125",
3+
"version": "1.2.126",
44
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
55
"type": "module",
66
"main": "dist/index.js",

src/utils/project.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,19 @@ export function getProjectType(dir: string = process.cwd()): string {
101101
}
102102
if (existsSync(join(dir, 'Cargo.toml'))) return 'Rust';
103103
if (existsSync(join(dir, 'go.mod'))) return 'Go';
104-
if (existsSync(join(dir, 'requirements.txt')) || existsSync(join(dir, 'setup.py'))) return 'Python';
104+
if (existsSync(join(dir, 'requirements.txt')) || existsSync(join(dir, 'setup.py')) || existsSync(join(dir, 'pyproject.toml'))) return 'Python';
105105
if (existsSync(join(dir, 'Gemfile'))) return 'Ruby';
106106
if (existsSync(join(dir, 'pom.xml')) || existsSync(join(dir, 'build.gradle'))) return 'Java';
107+
if (existsSync(join(dir, 'composer.json'))) return 'PHP';
108+
if (existsSync(join(dir, 'mix.exs'))) return 'Elixir';
109+
if (existsSync(join(dir, 'pubspec.yaml'))) return 'Dart/Flutter';
110+
if (existsSync(join(dir, 'CMakeLists.txt'))) return 'C/C++';
111+
// Fallback: detect by file count
112+
try {
113+
const files = readdirSync(dir);
114+
const phpFiles = files.filter(f => f.endsWith('.php')).length;
115+
if (phpFiles > 0) return 'PHP';
116+
} catch { /* ignore */ }
107117
return 'Unknown';
108118
}
109119

0 commit comments

Comments
 (0)