# LSP Configuration

The `lsp` section of the `atmos.yaml` configures the built-in LSP server and external LSP server
connections used by the Atmos AI assistant for validation.

> ⚠️ Experimental

## Quick Start

**File:** `atmos.yaml`

```yaml
lsp:
  enabled: true
```

## Configuration Reference

### Top-Level Structure

**File:** `atmos.yaml`

```yaml
lsp:
  enabled: true                          # Enable LSP integration
  servers:                               # External LSP server connections
    yaml-ls:
      command: "yaml-language-server"
      args: ["--stdio"]
      filetypes: ["yaml", "yml"]
      root_patterns: ["atmos.yaml", ".git"]
      initialization_options:
        yaml:
          schemas:
            "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json": "stacks/**/*.yaml"

    terraform-ls:
      command: "terraform-ls"
      args: ["serve"]
      filetypes: ["tf", "tfvars"]
      root_patterns: [".terraform", ".git"]
```

### LSP Settings

- **`enabled`**
  Enable or disable LSP integration (default: 
  `false`
  )

### Server Configuration

Each server in the `servers` map configures an external LSP server connection:

- **`command`**
  The executable command to run the LSP server (e.g., 
  `yaml-language-server`
  , 
  `terraform-ls`
  )
- **`args`**
  Command-line arguments passed to the server (e.g., 
  `["--stdio"]`
  )
- **`filetypes`**
  List of file extensions this server handles (e.g., 
  `["yaml", "yml"]`
  )
- **`root_patterns`**
  Patterns used to identify the workspace root directory (e.g., 
  `["atmos.yaml", ".git"]`
  )
- **`initialization_options`**
  Custom LSP initialization options passed to the server on startup. The structure depends on the specific LSP server.

## Guides

- **[LSP Server](/lsp/lsp-server)** — Set up IDE integration with the Atmos LSP server
- **[LSP Client](/lsp/lsp-client)** — Connect external LSP servers for AI-powered validation

## Related Commands
