Skip to content

๐Ÿ› ๏ธ Editor Setup Guide

Optimized development environment configuration for VS Code and Zed editors.

๐Ÿ“‹ Table of Contents


๐Ÿ†š VS Code Setup

๐Ÿ“ฆ Automatic Extension Installation

The workspace includes .vscode/extensions.json with recommended extensions. VS Code will prompt you to install them automatically.

Essential Extensions (Auto-installed):

  • TypeScript & React: ms-vscode.vscode-typescript-next, dsznajder.es7-react-js-snippets
  • Code Quality: esbenp.prettier-vscode, dbaeumer.vscode-eslint, usernamehw.errorlens
  • Testing: vitest.explorer
  • AI & Git: github.copilot, eamodio.gitlens
  • Styling: bradlc.vscode-tailwindcss

โš™๏ธ Workspace Settings

Pre-configured settings in .vscode/settings.json:

{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "explicit"
  },
  "typescript.preferences.quoteStyle": "double",
  "tailwindCSS.experimental.classRegex": [
    ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
  ]
}

๐ŸŽฏ Quick Actions

Command Palette (Cmd/Ctrl + Shift + P):

  • Tasks: Run Task - Access all project tasks
  • TypeScript: Restart TS Server - Fix IntelliSense issues
  • Developer: Reload Window - Refresh workspace
  • Preferences: Open Workspace Settings (JSON) - Edit workspace config

Task Shortcuts:

  • Ctrl+Shift+P โ†’ Tasks: Run Task
  • ๐Ÿš€ Start Development Server
  • ๐Ÿงช Run Unit Tests (Watch Mode)
  • ๐Ÿ”ง Fix Code Issues (Format + Lint)
  • ๐Ÿš€ Deploy to Staging

๐Ÿ› Debugging Configuration

Pre-configured launch configurations in .vscode/launch.json:

Available Debug Configurations

  1. ๐Ÿš€ Debug Next.js (Dev Server) - Full server debugging
  2. ๐ŸŒ Debug Next.js (Chrome) - Client-side debugging
  3. ๐Ÿ”— Attach to Next.js - Attach to running process
  4. ๐Ÿงช Debug Unit Tests (Vitest) - Debug specific tests

Quick Debug Actions

# Start debugging session
F5                    # Start debugging
Ctrl+Shift+F5        # Restart debugging
Shift+F5             # Stop debugging
F9                   # Toggle breakpoint
F10                  # Step over
F11                  # Step into

๐Ÿ“ File Explorer Enhancements

File Nesting (Enabled):

  • package.json groups package-lock.json, yarn.lock
  • README.md groups CONTRIBUTING.md, LICENSE
  • next.config.* groups next-env.d.ts
  • tsconfig.json groups tsconfig.*.json

Explorer Context Menu:

  • Right-click folders โ†’ "Open in Integrated Terminal"
  • Right-click .test.ts files โ†’ "Debug Test File"

๐Ÿ”ง Integrated Terminal

Pre-configured terminals:

  • Main: Development server (npm run dev)
  • Test: Test runner (npm run test -- --watch)
  • Build: Build tasks (npm run build)

Terminal Shortcuts:

Ctrl+`               # Toggle terminal
Ctrl+Shift+`         # Create new terminal
Ctrl+Shift+5         # Split terminal

โšก Zed Setup

๐ŸŽจ Project Configuration

Zed uses .zed/settings.json for project-specific configuration:

{
  "tab_size": 2,
  "format_on_save": "on",
  "code_actions_on_format": {
    "source.organizeImports": true,
    "source.fixAll.eslint": true
  },
  "languages": {
    "TypeScript": {
      "formatter": "prettier"
    },
    "TSX": {
      "formatter": "prettier"
    }
  }
}

๐Ÿš€ Built-in Tasks

Pre-configured tasks in .zed/settings.json:

Available Tasks:

  • ๐Ÿš€ Start Development Server (npm run dev)
  • ๐Ÿ”จ Build for Production (npm run build)
  • ๐Ÿงช Run Tests (npm run test)
  • ๐Ÿ” Lint Code (npm run lint)
  • ๐Ÿ’… Format Code (npm run format)
  • ๐Ÿ“š Start Storybook (npm run storybook)
  • ๐Ÿš€ Deploy to Staging (./scripts/deployment/deploy-staging.sh)

โŒจ๏ธ Keyboard Shortcuts

Task Execution:

Cmd+Shift+P          # Command palette
Cmd+Shift+R          # Run task
Cmd+T                # File finder
Cmd+Shift+F          # Project-wide search
Cmd+J                # Toggle terminal

๐Ÿค– AI Assistant Integration

Zed AI Features:

  • Copilot Integration: Built-in GitHub Copilot support
  • Assistant Panel: Right-side AI chat (if configured)
  • Inline Suggestions: Real-time code completions

๐ŸŽฏ Language Server Features

TypeScript LSP:

  • Auto-imports with correct relative paths
  • Real-time type checking
  • Intelligent refactoring suggestions
  • Go-to-definition across files

Tailwind CSS LSP:

  • Class name completions
  • Hover documentation
  • CSS-in-JS support (cva, cx functions)

๐Ÿ“Š Performance Optimizations

File Scanning:

  • Excludes node_modules, .next, coverage
  • Optimized for large projects
  • Fast file search and navigation

๐Ÿ”ง Common Configuration

๐Ÿ“ EditorConfig

Project includes .editorconfig:

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

๐ŸŽจ Prettier Configuration

Consistent formatting via prettier.config.js:

module.exports = {
  semi: true,
  trailingComma: "es5",
  singleQuote: false,
  printWidth: 80,
  tabWidth: 2,
  useTabs: false,
  plugins: ["prettier-plugin-tailwindcss"],
};

๐Ÿ“‹ ESLint Configuration

Type-safe linting via eslint.config.mjs:

import { fixupConfigRules } from "@eslint/compat";
import nextConfig from "eslint-config-next";

export default [
  ...fixupConfigRules(nextConfig),
  {
    rules: {
      "@typescript-eslint/no-unused-vars": "error",
      "@typescript-eslint/no-explicit-any": "error",
      "react-hooks/exhaustive-deps": "warn",
    },
  },
];

๐ŸŽฎ Quick Actions & Tasks

๐Ÿš€ Development Workflow

Start Development:

# VS Code: Ctrl+Shift+P โ†’ "Tasks: Run Task" โ†’ "๐Ÿš€ Start Development Server"
# Zed: Cmd+Shift+P โ†’ "task: start development server"
# Terminal: npm run dev

Run Tests:

# Unit tests (watch mode)
npm run test -- --watch

# Coverage report
npm run test:coverage

Code Quality:

# Fix formatting and linting
# VS Code: Task "๐Ÿ”ง Fix Code Issues"
npm run format && npm run lint

# Type checking
npm run type-check

# Full quality check
# VS Code: Task "โœ… Full Quality Check"

๐Ÿ”„ Git Workflow Integration

Pre-commit Hooks (Husky):

  • Automatic linting and formatting
  • Type checking before commits
  • Test validation

GitLens (VS Code) Features:

  • Inline blame annotations
  • File history and comparisons
  • Branch and stash management

๐Ÿš€ Deployment

Quick Deploy:

# VS Code: Task "๐Ÿš€ Deploy to Staging"
# Terminal:
cd scripts/deployment
./deploy-staging.sh

๐Ÿ› Debugging Setup

๐Ÿ” Debugging Next.js Applications

Server-Side Debugging

  1. Start Debug Session:
  2. VS Code: F5 โ†’ Select "๐Ÿš€ Debug Next.js (Dev Server)"
  3. Zed: Use integrated terminal with --inspect flag

  4. Set Breakpoints:

  5. API routes: src/app/api/**/*.ts
  6. Server components: src/app/**/*.tsx
  7. Services: src/lib/services/**/*.ts

  8. Debug Console:

  9. Inspect variables
  10. Evaluate expressions
  11. Call stack navigation

Client-Side Debugging

  1. Chrome DevTools Integration:
  2. VS Code: F5 โ†’ Select "๐ŸŒ Debug Next.js (Chrome)"
  3. Automatic source map resolution
  4. React DevTools extension

  5. Common Debug Points:

  6. React components: src/components/**
  7. Custom hooks: src/lib/hooks/**
  8. Client-side utilities: src/lib/utils/**

๐Ÿงช Testing & Debugging

Unit Test Debugging

VS Code:

  1. Open test file
  2. F5 โ†’ Select "๐ŸŽฏ Debug Current Test File"
  3. Set breakpoints in test or source code

Zed:

  1. Use terminal: npm run test -- --inspect-brk <file>
  2. Attach debugger to process

โšก Performance Tips

๐Ÿš€ Editor Performance

VS Code Optimizations

  1. Disable Unused Extensions:
{
  "extensions.autoUpdate": false,
  "extensions.ignoreRecommendations": true
}
  1. Optimize TypeScript:
{
  "typescript.disableAutomaticTypeAcquisition": true,
  "typescript.preferences.includePackageJsonAutoImports": "off"
}
  1. File Watching:
{
  "files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/**": true,
    "**/.next/**": true
  }
}

Zed Optimizations

  1. File Scanning: Pre-configured exclusions
  2. LSP Settings: Optimized for large projects
  3. UI Responsiveness: Native performance benefits

๐Ÿ”ง Development Server Performance

Turbopack Configuration:

# Already enabled in package.json
npm run dev  # Uses --turbopack flag
npm run build  # Uses --turbopack flag

Memory Usage:

  • VS Code: Monitor via Task Manager
  • Zed: Generally lower memory footprint
  • Node.js: Use --max-old-space-size=4096 if needed

๐Ÿ”ง Troubleshooting

๐Ÿšจ Common Issues

TypeScript Issues

Problem: IntelliSense not working

# VS Code
Cmd+Shift+P โ†’ "TypeScript: Restart TS Server"

# Zed
Restart language server via command palette

Problem: Import suggestions not working

// Add to settings.json
{
  "typescript.suggest.autoImports": true,
  "typescript.preferences.importModuleSpecifier": "relative"
}

ESLint Issues

Problem: Linting not working on save

{
  "eslint.format.enable": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  }
}

Prettier Issues

Problem: Formatting not consistent

# Check configuration
npx prettier --check .

# Fix all files
npx prettier --write .

๐Ÿงช Test Issues

Vitest Issues

Problem: Tests not running in VS Code

  1. Install Vitest extension
  2. Configure test runner: Cmd+Shift+P โ†’ "Test: Configure"

๐Ÿš€ Deployment Issues

Problem: Build failures

# Clean build
rm -rf .next
npm run build

# Check environment variables
npm run type-check

๐Ÿ“ฑ Extension Conflicts

VS Code Extension Issues:

  1. Disable all extensions
  2. Enable one by one to identify conflicts
  3. Check extension compatibility

Recommended Extension Combination:

  • Keep core language extensions
  • Use official Microsoft extensions
  • Avoid duplicate functionality

๐ŸŽฏ Best Practices

๐Ÿ“ Workspace Organization

  1. Use Workspace Folders: Organize large projects
  2. Configure File Nesting: Reduce clutter
  3. Set Up Tasks: Automate common operations
  4. Configure Debugging: Set up launch configurations

๐Ÿ”„ Workflow Integration

  1. Git Integration: Use built-in Git features
  2. Task Automation: Leverage editor tasks
  3. Testing Integration: Use test explorers
  4. AI Assistance: Configure Copilot/Assistant

๐ŸŽจ Code Quality

  1. Format on Save: Consistent formatting
  2. Lint on Save: Catch issues early
  3. Auto Imports: Organize imports
  4. Type Checking: Enable strict mode

๐Ÿ“š Additional Resources

๐Ÿ“– Documentation

๐ŸŽ“ Learning Resources

๐Ÿค– AI Integration


Happy coding! ๐Ÿš€

This guide is regularly updated to reflect the latest editor features and project requirements.