Overview
This guide covers advanced features and techniques for using Draw Folder Structure in complex projects. Learn how to optimize performance, combine settings strategically, and handle edge cases.Recursion Control
TheallowRecursion setting controls whether the extension explores subdirectories when generating structures.
How It Works
When you right-click on a folder:allowRecursion: true(default) - Generates a complete tree of all subdirectoriesallowRecursion: false- Shows only immediate children (one level deep)
Configuration
Use Cases
Top-Level Overview
Top-Level Overview
Disable recursion when you only want to show the main structure:Result for a project:Perfect for high-level documentation that doesn’t need implementation details.
Performance Optimization
Performance Optimization
For very large projects (1000+ files), disabling recursion on the root folder improves generation speed:Then selectively run the command on specific subdirectories with recursion enabled.
Documentation Sections
Documentation Sections
Generate separate structures for different sections:settings.json:Workflow:
- Right-click
src/folder → Generate structure → Copy to “Source Code” section - Right-click
tests/folder → Generate structure → Copy to “Test Suite” section - Right-click
docs/folder → Generate structure → Copy to “Documentation” section
Recursion with Exclusions
Combine recursion with exclusions for fine-grained control:.gitignore Integration
TherespectGitignore setting instructs the extension to honor your project’s .gitignore rules.
How It Works
When enabled, the extension:- Locates the
.gitignorefile in your project root - Parses the patterns defined in it
- Excludes any matching files or folders from the generated structure
Configuration
Use Cases
Clean Repository View
Clean Repository View
Show only files that are tracked by Git:This is perfect for documentation that mirrors your repository structure.
Environment-Aware Structures
Environment-Aware Structures
Your
.gitignore typically excludes:- Environment files (
.env,.env.local) - Build artifacts
- Dependencies
- IDE files
respectGitignore to automatically exclude all of these without manually configuring exclusion patterns.Team Consistency
Team Consistency
When your team shares a Commit this configuration in
.gitignore, enabling this setting ensures everyone generates consistent structure documentation:.vscode/settings.json for team-wide consistency.Combining with Exclusion Patterns
Exclusion patterns and.gitignore work additively:
Example Scenario
Your .gitignore:.gitignore PLUS docs/drafts/.
Combining Multiple Settings
The real power comes from combining all settings for complex scenarios.Scenario 1: Large Monorepo
Challenge: Generate documentation for a monorepo with multiple packages. Solution:- Right-click the
packages/folder to see all packages - Right-click individual packages for detailed views
Scenario 2: Documentation-Only Structure
Challenge: Show only source files relevant for documentation. Solution:Scenario 3: API Documentation
Challenge: Document only the API routes and handlers. Solution:api/ or routes/ folder to generate API-specific documentation.
Scenario 4: Quick Root Overview
Challenge: Show only the root-level structure for project README. Solution:Scenario 5: Multi-Language Project
Challenge: Document a project with backend and frontend in different languages. Solution:Performance Tips
Optimize structure generation for large projects:Exclude Large Directories First
Exclude Large Directories First
Always exclude the largest directories:This can reduce generation time from minutes to seconds.
Use Recursion Strategically
Use Recursion Strategically
For projects with 1000+ files:
- Disable recursion at root level:
- Generate top-level structure
- Re-enable recursion:
- Generate structures for specific subdirectories
Leverage .gitignore
Leverage .gitignore
Enable This is faster than maintaining extensive exclusion lists.
respectGitignore to automatically exclude most irrelevant files:Use Specific Patterns
Use Specific Patterns
Slow (scans more files):Faster (more specific):More specific patterns reduce the scanning scope.
Workspace-Specific Configurations
For projects with unique requirements, use workspace settings.Creating Workspace Settings
- Create
.vscode/settings.jsonin your project root:
- Commit this file to version control
- Team members get consistent structure generation
Multiple Profile Strategy
Use VS Code profiles for different documentation needs: Profile 1: Developer DocumentationAdvanced Exclusion Techniques
Dynamic Exclusions Based on Context
Adjust exclusions for different contexts:- API Documentation
- Frontend Documentation
- Full Stack Documentation
Excluding Generated Code
Many projects have code generation tools. Exclude generated files:Troubleshooting
Structure Takes Too Long to Generate
Structure Takes Too Long to Generate
Causes:
- Not excluding large directories (node_modules, .git)
- Too many files being scanned
- Add common exclusions:
- Enable
respectGitignore - Try
allowRecursion: falsefor initial scan
Important Files Are Missing
Important Files Are Missing
Causes:
- Too aggressive exclusion patterns
.gitignoreexcluding necessary files
- Review your exclusion patterns
- Disable
respectGitignoretemporarily: - Use negation patterns to include specific files:
Structure Doesn't Match Expectations
Structure Doesn't Match Expectations
Causes:
- Recursion disabled when you need it
- Workspace settings overriding user settings
- Check recursion setting:
- Check for workspace settings in
.vscode/settings.json - Verify exclusion patterns are correct
Best Practices Summary
Start Simple
Begin with default settings and add exclusions as needed. Don’t over-configure initially.
Use .gitignore
Enable
respectGitignore for automatic, consistent exclusions across your team.Document Your Config
Add comments in
.vscode/settings.json to explain project-specific patterns.Test Incrementally
Make one configuration change at a time and test the output before adding more.
Real-World Examples
Next.js Blog Project
React Component Library
Express.js API Server
Next Steps
Configuration Reference
Detailed reference for all configuration options
Exclusion Patterns
Deep dive into glob pattern syntax
Styling Options
Explore all available visual styles
API Reference
Complete API documentation