Project Scanner
The Project Scanner feature in DevoxxGenie allows you to add your project source code to the prompt context, enabling the LLM to provide more relevant and project-specific responses.
Overview
The Project Scanner:
- Analyzes your project structure
- Extracts code from files based on your selection
- Adds this code to the prompt context
- Allows the LLM to understand your project's architecture and patterns
This feature is particularly valuable for:
- Getting suggestions that align with your existing code style
- Asking questions about your project architecture
- Generating code that integrates well with your codebase
Using Project Scanner
Adding Project Files to Context
Add Entire Project
To add your entire project to the prompt context:
- Click the "Add Project" button in the DevoxxGenie toolbar
- DevoxxGenie will scan your project and add relevant files to the context
- A token count and file count will be displayed
Add Specific Directory
To add a specific directory:
- Right-click on a directory in the project view
- Select "Add Directory to Prompt Context"
- The directory contents will be added to the context
Add Individual Files
To add individual files:
- Right-click on a file in the project view
- Select "Add File(s) To Prompt Context"
- Or drag and drop files from the project view into the DevoxxGenie window
Viewing Added Files
The DevoxxGenie interface shows files that have been added to the context:
- Each file is listed with its path in the "Context Files" panel
- A token usage bar shows how much of the available context window is being used
- You can remove files by clicking the "x" next to their names
Configuring Project Scanner
To configure how Project Scanner works:
- Open DevoxxGenie settings
- Navigate to "Scan & Copy Project"
- Configure your preferences
Configuration Options
Include/Exclude Patterns
- Include Extensions: Specify which file extensions to include (e.g., java, kt, xml)
- Exclude Directories: Specify directories to exclude (e.g., build, target, .git)
- Use .gitignore: Automatically exclude files listed in your .gitignore
Content Filtering
- Remove JavaDocs: Option to strip JavaDoc comments to reduce token count
- Max File Size: Set a limit for file sizes to include
- Line Limit: Set a maximum number of lines per file
Project-Wide Settings
- Scan Depth: Set how deep in the directory tree to scan
- File Limit: Set a maximum number of files to include
- Token Limit: Set a maximum token count for the entire context
Token Management
Project Scanner includes token management features:
Token Calculation
To calculate tokens for a directory:
- Right-click on a directory in the project view
- Select "Calc Tokens for Directory"
- View token count, estimated cost, and compatible models
Context Window Management
The interface shows:
- Current token usage versus context window size
- Warning if you approach the context window limit
- Recommendations for larger context window models if needed
Smart Model Selection
When using "Add Project":
- The total token count is calculated
- Only models that can handle the token count are enabled
- Cost estimation is provided for cloud models
Language-Specific Features
Project Scanner has special handling for different programming languages:
Java Support
- AST (Abstract Syntax Tree) context for Java files
- Special handling for Java packages and imports
- Recognition of Java design patterns
Other Language Support
Support for other languages includes:
- Kotlin
- Python
- JavaScript/TypeScript
- PHP
- Go
- Rust
- C/C++
Each language has specific extensions that recognize its file patterns and structure.
Best Practices
Optimizing Context
For the best results with Project Scanner:
- Be selective: Include only relevant parts of your project
- Focus on core files: Prioritize models, services, and interfaces
- Exclude generated code: Generated code adds tokens without adding value
- Remove test files: Unless you're specifically asking about tests
- Balance size and completeness: Include enough for context but not so much it dilutes focus
When to Use Project Scanner
Project Scanner is most useful when:
- Asking about project-specific architecture or patterns
- Generating code that needs to integrate with existing code
- Refactoring that requires understanding of dependencies
- Asking for improvements that match your code style
It may be less useful for:
- General programming questions not related to your project
- Very simple code generation tasks
- When working with very large projects that exceed context limits
Advanced Features
Language Support Extensions
DevoxxGenie uses language-specific extensions to better understand your code:
graph TD
A[ProjectAnalyzer] -->|uses| B[ProjectAnalyzerExtension]
B -->|implemented by| C[JavaProjectScannerExtension]
B -->|implemented by| D[KotlinProjectScannerExtension]
B -->|implemented by| E[PythonProjectScannerExtension]
B -->|implemented by| F[JavaScriptProjectScannerExtension]
B -->|implemented by| G[Other language extensions...]
These extensions provide language-aware scanning to:
- Identify important structural elements
- Recognize language-specific patterns
- Filter out less relevant code
DEVOXXGENIE.md Integration
Project Scanner works with DEVOXXGENIE.md:
- The DEVOXXGENIE.md file provides high-level project information
- Project Scanner adds specific code details
- Together they give the LLM both the "big picture" and specific implementations
Troubleshooting
Common Issues
Token Limit Exceeded
If you exceed the token limit:
- Be more selective about which directories to include
- Configure Project Scanner to exclude more files
- Use a model with a larger context window
- Consider using RAG instead for very large projects
Slow Performance
If scanning is slow:
- Exclude more directories
- Set a lower file size limit
- Reduce scan depth
- Use more specific inclusion patterns
Irrelevant Code Included
If irrelevant code is being included:
- Review your include/exclude patterns
- Configure language-specific exclusions
- Manually select directories instead of scanning the whole project
- Use the "Remove JavaDocs" option to reduce noise
Future Enhancements
The DevoxxGenie team is working on several enhancements to Project Scanner:
- Smarter code selection: Automatically identify the most relevant files for a given query
- Dependency awareness: Better understanding of dependencies between files
- Structure summarization: Include summaries instead of full code for some files
- Integration with RAG: Combined approach using both scanning and retrieval