> ## Documentation Index
> Fetch the complete documentation index at: https://alexcode.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Error & Warning Resolution

> Learn how to use Alex Sidebar to quickly resolve Xcode errors and warnings

## Quick Fix Integration

Alex Sidebar seamlessly integrates with Xcode's diagnostic system to help resolve errors and warnings efficiently.

<CardGroup cols={2}>
  <Card title="One-Click Access" icon="bolt">
    Click any error or warning indicator in Xcode's gutter to get instant
    AI-powered solutions.
  </Card>

  <Card title="Smart Analysis" icon="brain">
    Automatic context gathering and error analysis for targeted fixes.
  </Card>
</CardGroup>

## Using Quick Fix

<Steps>
  <Step title="Trigger Quick Fix">
    Hover over the line containing the red (error) or yellow (warning) indicator in Xcode's, then click the indicator

    <Frame>
      <img src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/images/warning-xcode.png?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=cac9f4a6c4aed367eb9b28b0ff606903" alt="Xcode error indicator in the gutter that can be clicked to trigger quick fix" width="1580" height="248" data-path="images/warning-xcode.png" />
    </Frame>
  </Step>

  <Step title="Review Suggestions">
    Alex Sidebar starts a new chat with the warning and error message and code context.

    <Frame>
      <img src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/images/warning-fix-chat.png?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=7b10b1d6ec14308f46fd7f2032ac9fef" alt="Alex Sidebar chat interface with warning context and suggestions" width="1422" height="1184" data-path="images/warning-fix-chat.png" />
    </Frame>
  </Step>

  <Step title="Apply Solution">
    Click "Apply" to implement the suggested changes. The smart apply button will handle both simple fixes like missing imports and complex changes that require accurate diffing. For faster application, use Quick Apply (⏩) to instantly apply changes without the diff panel.

    <Frame>
      <img src="https://mintcdn.com/alex/zS4a0pdjtofRLVUw/images/warning-solution-chat.png?fit=max&auto=format&n=zS4a0pdjtofRLVUw&q=85&s=4d96149be2cb3358f6a54951cd029690" alt="Alex Sidebar quick fix apply interface" width="1152" height="1052" data-path="images/warning-solution-chat.png" />
    </Frame>

    <Warning>
      Always review the proposed changes before applying them to ensure they
      match your codebase requirements
    </Warning>
  </Step>
</Steps>

## Common Fixes

<AccordionGroup>
  <Accordion title="Build Errors">
    Handles common build-time issues:

    * Missing imports
    * Type mismatches
    * Protocol conformance
    * Initialization errors
    * Access control issues
  </Accordion>

  <Accordion title="Runtime Warnings">
    Addresses potential runtime problems:

    * Memory management
    * Thread safety
    * Deprecated API usage
    * Performance optimizations
    * Best practice violations
  </Accordion>

  <Accordion title="SwiftUI Previews">
    Resolves preview-specific issues:

    * Missing preview providers
    * Environment requirements
    * Device configuration
    * Preview context setup
  </Accordion>
</AccordionGroup>

## Advanced Usage

<AccordionGroup>
  <Accordion title="Custom Error Handling">
    For specialized error cases:

    * Select the problematic code
    * Use Command + L to start a chat
    * Provide additional context
    * Get customized solutions
  </Accordion>

  <Accordion title="Batch Fixes">
    When dealing with multiple related issues:

    * Group similar errors using Command + Shift + L to add the context in the existing chat
    * Apply fixes systematically
    * Validate changes incrementally
  </Accordion>
</AccordionGroup>

<Note>
  Pro Tip: Use the chat interface for more complex error scenarios that might
  require additional context or explanation.
</Note>
