diff --git a/package-lock.json b/package-lock.json index f239e3c..057d32c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "claude-dev", - "version": "1.0.64", + "version": "1.0.65", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "claude-dev", - "version": "1.0.64", + "version": "1.0.65", "license": "MIT", "dependencies": { "@anthropic-ai/sdk": "^0.24.3", diff --git a/package.json b/package.json index c983d0c..f575685 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Claude Dev", "description": "Autonomous software engineer right in your IDE, capable of reading/writing files, executing commands, and more with your permission every step of the way.", - "version": "1.0.62", + "version": "1.0.65", "icon": "icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/analyze-project/index.ts b/src/analyze-project/index.ts index 1a42691..04bb270 100644 --- a/src/analyze-project/index.ts +++ b/src/analyze-project/index.ts @@ -3,16 +3,16 @@ import { globby } from "globby" import * as path from "path" import { LanguageParser, loadRequiredLanguageParsers } from "./languageParser" +// TODO: implement caching behavior to avoid having to keep analyzing project for new tasks. async function analyzeProject(dirPath: string): Promise { - let result = "" - // Get all files (not gitignored) const allFiles = await getAllProjectFiles(dirPath) + let result = `Project: ${path.basename(dirPath)} (${allFiles.length.toLocaleString()} files)\n\n` + // Separate files to parse and remaining files const { filesToParse, remainingFiles } = separateFiles(allFiles) - // Load only the necessary language parsers const languageParsers = await loadRequiredLanguageParsers(filesToParse) // Parse specific files we have language parsers for @@ -20,9 +20,6 @@ async function analyzeProject(dirPath: string): Promise { for (const file of filesToParse) { const definitions = await parseFile(file, languageParsers) if (definitions) { - if (!result) { - result += "# Source code definitions:\n\n" - } result += `${path.relative(dirPath, file)}\n${definitions}\n` } else { filesWithoutDefinitions.push(file) @@ -30,7 +27,6 @@ async function analyzeProject(dirPath: string): Promise { } // List remaining files' paths - result += "# Unparsed files:\n\n" filesWithoutDefinitions .concat(remainingFiles) .sort() @@ -98,8 +94,8 @@ function separateFiles(allFiles: string[]): { filesToParse: string[]; remainingF "php", "swift", ].map((e) => `.${e}`) - const filesToParse = allFiles.filter((file) => extensions.includes(path.extname(file))) - const remainingFiles = allFiles.filter((file) => !extensions.includes(path.extname(file))) + const filesToParse = allFiles.filter((file) => extensions.includes(path.extname(file))).slice(0, 50) // 50 files max + const remainingFiles = allFiles.filter((file) => !filesToParse.includes(file)) return { filesToParse, remainingFiles } }