# EkLine VS Code Integration

## Prerequisites

Active EkLine account and Integration Token.

> **Note:** Retrieve your token from **Settings > Organization > Access** in the **[EkLine Dashboard](https://ekline.io/dashboard)**.

## Supported file types

The extension works with the following file types:
- Markdown (`.md`)
- MDX (`.mdx`)
- HTML (`.html`)
- reStructuredText (`.rst`)
- Plain text (`.txt`)
- AsciiDoc (`.adoc`)

## Installation

Choose one of the following methods to install the extension.

**Method 1: VSCode Marketplace (Recommended)**
1. Open **Visual Studio Code**.
2. Navigate to the **Extensions** view (Activity Bar).
3. Search for `EkLine`.
4. Click **Install**.

**Method 2: Web Browser**
1. Visit the **[EkLine Extension Page](https://marketplace.visualstudio.com/items?itemName=EkLine.ekline-vscode)**.
2. Click **Install**.

## Configuration

### 1. Authentication
Upon installation, a prompt appears requesting your integration token.
1. Enter your **EkLine Integration Token**.
2. Press `Enter` to activate.

*If you miss the prompt:* Open the Command Palette (`Cmd/Ctrl` + `Shift` + `P`) and run `EkLine: Configure Extension`.

### 2. Workspace settings
Access configuration via **Settings** > **Extensions** > **EkLine** or by editing your `.vscode/settings.json`.

| Setting | Description | Default |
| :--- | :--- | :--- |
| **EkLine Token** | Your unique integration key. You can set it at the User or Workspace level. | N/A |
| **Documentation Paths** | Array of directories to review relative to workspace root. Add paths in VS Code settings UI or as a JSON array in `settings.json`. | `["src"]` |
| **Style Guide** | Select the standard for review (Google, Microsoft, Marketing, or Custom). | `Google` |
| **Review On Open** | Automatically review documents when they are opened. Disable to review only on demand or on save. | `true` |
| **Review On Save** | Automatically review documents when they are saved. Disable to review only on demand or on open. | `true` |
| **AI False Positive Filtering** | Use AI to filter likely false positives from style rule results. Disable for fully deterministic output across every scan. | `true` |
| **Enable AI Rules For Repo Wide Scans** | Run AI-powered rules when scanning the entire repository with **Review all documents**. AI rules are skipped by default on repo-wide scans because they are slower. Single-file scans always include AI rules. | `false` |
| **Disabled** | Toggle to disable the extension without uninstalling it. | `false` |
| **Debug** | Enable debug mode for troubleshooting. | `false` |

## Usage & commands

By default, EkLine reviews supported files automatically when you open or save them. You can disable either trigger with the **Review On Open** and **Review On Save** settings, or trigger reviews manually at any time.

### Core commands
Access these via the Command Palette (`Cmd/Ctrl` + `Shift` + `P`).

| Command | Function |
| :--- | :--- |
| `EkLine: Review all documents` | Analyzes all files in the configured paths. |
| `EkLine: Review current document` | Analyzes only the active file. |
| `EkLine: Improve writing in current file` | Triggers EkLine AI to enhance the active file's content. |
| `EkLine: Configure Extension` | Opens the token configuration prompt. |

> **Note**: **Review all documents** skips AI-powered rules by default to keep repo-wide scans fast. Single-file reviews always include AI rules. To enable AI rules on repo-wide scans, turn on the **Enable AI Rules For Repo Wide Scans** setting.

### Keyboard shortcuts

| Shortcut | Context | Action |
| :--- | :--- | :--- |
| `Cmd+Alt+E` (Mac) / `Ctrl+Alt+E` (Windows/Linux) | Text selected | Opens Ask EkLine with the selected text |
| `Cmd+Alt+E` (Mac) / `Ctrl+Alt+E` (Windows/Linux) | No selection, cursor on empty line | Opens prompt to add content at cursor position |

### AI assistant (Ask EkLine)
Use the AI assistant to generate content or refactor existing text. Select text and right-click to choose **Improve with EkLine AI**.

#### 1. Refactoring text
1. Highlight the text to improve.
2. Right-click and select **Improve with EkLine AI**.
3. Input your instruction and press `Enter`.
4. Review the Diff View and accept (`✓`) or reject (`✗`) changes.

#### 2. Generating content
1. Place cursor on an empty line.
2. Right-click and select **Improve with EkLine AI**.
3. Enter prompt to generate text at that location.

#### 3. Contextual prompts
Reference specific files to give the AI context:
* **In Input Box:** Type `@` followed by the filename (for example, `@utils.ts`).
* **In Editor:** Type `@ekline` followed by a prompt directly in the file. Click the appearing CodeLens to execute.

## EkLine suggestions panel

The extension adds an **EkLine** icon to the Activity Bar (left sidebar). Click it to open the **EkLine Suggestions** panel, which displays:
- Real-time linting suggestions for the current file
- AI assistant interface for quick improvements

## Diff view

When EkLine AI suggests changes, they appear in a side-by-side diff view:
- **Accept (`✓`)**: Click the checkmark button in the editor title bar to apply changes.
- **Reject (`✗`)**: Click the X button to discard changes

The diff view lets you review AI-suggested improvements before applying them to your document.

## Troubleshooting

Common issues and how to resolve them.

### Symptoms

- [EkLine stops reviewing docs when I switch repositories](#ekline-stops-reviewing-docs-when-i-switch-repositories)
- [Authentication errors despite entering my token](#authentication-errors-despite-entering-my-token)

### EkLine stops reviewing docs when I switch repositories

User settings override Workspace settings for **Documentation Paths**. If you configure paths in your global User settings, those paths apply to all workspaces—ignoring workspace-specific settings.

To use different Documentation Paths per repository:

1. Open Command Palette (`Cmd/Ctrl` + `Shift` + `P`).
2. Run **Preferences: Open User Settings (JSON)**.
3. Remove the `ekline-vscode.DocumentationPaths` line if present.
4. Save and close User settings.
5. Open Command Palette and run **Preferences: Open Workspace Settings (JSON)**.
6. Add the Documentation Paths for this repository:
   ```json
   {
     "ekline-vscode.DocumentationPaths": ["docs"]
   }
   ```
7. Repeat steps 5-6 for each repository, using the correct paths for that project.

> **Note:** This precedence behavior applies only to Documentation Paths. Other settings like EkLine Token use workspace-first precedence.

### Authentication errors despite entering my token

The extension reads the token from these sources in order:

1. Workspace settings (`.vscode/settings.json`)
2. User settings (global)
3. Environment variable (`EKLINE_EK_TOKEN`)

If you have the token in multiple locations with different values, the extension uses the first one found. To verify which source is active, enable **Debug** mode in settings and check the Output panel for EkLine logs.

## Next steps

- [Ignoring rules](/reviewer/configuration/ignoring-rules/) — handle false positives and suppress specific checks
- [Framework support](/reviewer/configuration/framework-support/) — configure EkLine for MDX, Astro, Docusaurus, and other frameworks
- [CLI integration](/reviewer/integrations/cli-integration/) — run reviews from the command line or in CI pipelines
- [Docs Agent](/agent/) — generate and update documentation from your codebase with AI