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

# Enhanced Code Intelligence

> Access Bezi's enhanced code editing capabilities

## What is enhanced code intelligence?

Enhanced code intelligence provides advanced code editing capabilities for your Unity project, inside Bezi. This currently includes improved refactoring and compilation error assistance.

This guide covers the prerequisites and setup required to enable enhanced code intelligence.

## Prerequisites

To enable enhanced code intelligence, your project must meet two core requirements:

### 1) .NET SDK installation

You must have the .NET SDK installed globally on your system. This lets Bezi develop a deeper understanding of the code.

**Default installation locations:**

* macOS (Intel): `/usr/local/share/dotnet/x64/dotnet`
* macOS (Apple Silicon): `/usr/local/share/dotnet`
* Windows: `C:\Program Files\dotnet`

**Setup steps:**

1. Download and install the appropriate .NET SDK for your Unity version from [the .NET website](https://dotnet.microsoft.com/en-us/download)
   * For Unity-specific .NET requirements, see [Unity's .NET Profile Support documentation](https://docs.unity3d.com/2022.3/Documentation/Manual/dotnetProfileSupport.html)
2. Close out of, then relaunch the Bezi app
3. Navigate to the bottom right. If .NET was the only issue, the enhanced code intelligence UI should be set to active.

### 2) Project naming convention

Your Unity project name must match its corresponding `.sln` file:

* The `.sln` file must be located at the project root (adjacent to the **Assets** folder)
* The filename must exactly match your project name

**Example:**

```
My-Unity-Project/
├── Assets/
├── Library/
├── ProjectSettings/
└── My-Unity-Project.sln ← Must match project name
```

### How to generate the .sln file

1. In Unity, go to `Unity` > `Preferences` > `External Tools`
2. Temporarily set the **External Script Editor** to Visual Studio Code (or any supported editor)

   <Warning>
     If you use Cursor and no other IDE, Unity will not recognize it as a supported editor and will not create the .sln file. In that case, **install a supported IDE** to create the .sln then set the **External Script Editor** back to Cursor.
   </Warning>
3. Check all the boxes for:
   * Embedded packages
   * Local packages
   * Registry packages
   * Built-in packages
4. Select `Regenerate project files`
5. Confirm the generated `My-Unity-Project.sln` file exists
6. Restart Bezi app

## Status indicators

The enhanced code intelligence service will display different states to indicate its current status

<AccordionGroup>
  <Accordion title="Active">
    All prerequisites are met and the service is running correctly:

    * **What it means:** Enhanced features are fully operational
    * **Features available:** Improved refactoring and self-healing
    * **Action required:** None - you're good to go!
  </Accordion>

  <Accordion title="Initializing">
    In the initial setup phase:

    * **What it means:** The service is analyzing your project structure
    * **Duration:** This may take a few minutes depending on project size
    * **Note:** You can still submit prompts during initialization, though some features may be limited
  </Accordion>

  <Accordion title="Missing dependencies">
    Prerequisites are not met:

    * **What it means:** One or more required components are missing
    * **Common causes:**
      * `.sln` file doesn't match project name
      * .NET SDK not installed or not found in PATH
    * **Action required:** Review the prerequisites above and ensure both requirements are met
  </Accordion>

  <Accordion title="Inactive">
    An unexpected error has occured:

    * **What it means:** The service encountered an error during initialization
    * **Action required:** Check your project setup, then contact support via our [Discord server](https://discord.com/invite/UKWB46HTT9)
  </Accordion>
</AccordionGroup>

## Troubleshooting

### Solution file not found

1. Check that your `.sln` file exists at the project root
2. Verify the filename matches your project name exactly (case-sensitive)
3. If missing, open your project in Unity to regenerate the solution file

### Unsupported script editor (Cursor, etc.)

1. Install a supported script editor
2. Temporarily set that as the **External Script Editor**
3. Follow instructions (above) to regenerate the solution file
4. Set the **External Script Editor** back to Cursor

### .NET SDK issues

1. Confirm installation: `dotnet --version`
2. Ensure the SDK version is compatible with your Unity version
3. Restart Bezi after installing the SDK
4. Check that the SDK is properly added to your system PATH

### Service won't initialize

1. Verify both prerequisites are met
2. Try closing and reopening your project
3. Check for any error messages in the status indicator
4. If issues persist, reach out on [Discord](https://discord.com/invite/UKWB46HTT9) with your project details

If you have any unanswered questions or need additional support, visit our [Discord server](https://discord.com/invite/UKWB46HTT9)
