Skip to main content

VS Code Integration

Integrate InitRepo with Visual Studio Code to provide intelligent documentation and AI assistance directly in your development environment.

Features

  • Context-Aware Documentation: Access project documentation from VS Code
  • AI Code Completions: Enhanced suggestions based on your project structure
  • Documentation Generation: Generate docs directly from your codebase
  • Code Analysis: Real-time analysis and recommendations

Setup

1

Install Extension

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for “InitRepo”
  4. Click Install
2

Configure API Key

Add your InitRepo API key to VS Code settings:
{
  "initrepo.apiKey": "your_api_key_here",
  "initrepo.projectId": "your_project_id"
}
3

Connect Project

Link your VS Code workspace to an InitRepo project:
  • Open Command Palette (Ctrl+Shift+P)
  • Run “InitRepo: Connect Project”
  • Select your project from the list

Features

Smart Documentation

Access context-aware documentation while coding:
// Hover over any function or class to see documentation
function calculateTotal(items) {
  // Press Ctrl+K Ctrl+I to show documentation
  return items.reduce((sum, item) => sum + item.price, 0);
}

Code Analysis

Get real-time code analysis and suggestions:
// InitRepo will suggest improvements and documentation
interface User {
  id: string;
  name: string;
  email: string;
}

class UserService {
  async createUser(userData: Partial<User>) {
    // AI suggestions for validation, error handling, etc.
  }
}

Documentation Generation

Generate documentation from your code:
# Use command palette or right-click menu
InitRepo: Generate Documentation

# Or use the terminal
initrepo docs generate --vscode

Extension Commands

CommandDescription
InitRepo: Analyze FileAnalyze current file for improvements
InitRepo: Generate DocsGenerate documentation for project
InitRepo: Show ContextDisplay project context and documentation
InitRepo: Code ReviewGet AI-powered code review

Configuration Options

{
  "initrepo": {
    "apiKey": "your_key",
    "projectId": "project_id",
    "autoAnalysis": true,
    "documentationFormat": "markdown",
    "suggestionsEnabled": true
  }
}

Troubleshooting

Common Issues

  • Restart VS Code
  • Check VS Code version (minimum v1.70.0)
  • Reinstall the extension
  • Verify API key is correct
  • Check internet connection
  • Ensure InitRepo service is accessible
  • Confirm project is connected
  • Check file permissions
  • Verify project structure is supported