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

# VS Code Integration

> Use Qwen Code natively in Visual Studio Code with the official extension

The Qwen Code Companion extension brings Qwen Code directly into Visual Studio Code with a native chat panel, diff view, and seamless workspace integration. Everything you need is bundled—no additional CLI installation required.

<Frame>
  <video src="https://cloud.video.taobao.com/vod/IKKwfM-kqNI3OJjM_U8uMCSMAoeEcJhs6VNCQmZxUfk.mp4" controls width="100%">
    Your browser does not support the video tag.
  </video>
</Frame>

## Features

<CardGroup cols={2}>
  <Card title="Native IDE Experience" icon="window">
    Dedicated Qwen Code Chat panel accessed via the Qwen icon in the editor title bar
  </Card>

  <Card title="Native Diffing" icon="code-compare">
    Review, edit, and accept changes in VS Code's native diff view
  </Card>

  <Card title="Auto-Accept Mode" icon="bolt">
    Automatically apply Qwen's changes as they're made for faster workflows
  </Card>

  <Card title="File Management" icon="file">
    @-mention files or attach files and images using the system file picker
  </Card>

  <Card title="Conversation History" icon="clock-rotate-left">
    Access past conversations and run multiple sessions simultaneously
  </Card>

  <Card title="Context Awareness" icon="eye">
    Share active files, cursor position, and selections for more precise help
  </Card>
</CardGroup>

## Requirements

* **Visual Studio Code** 1.85.0 or newer
* Also works with **Cursor**, **Windsurf**, and other VS Code-based editors

## Installation

<Steps>
  <Step title="Install from Marketplace">
    Install the extension from one of these sources:

    * [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=qwenlm.qwen-code-vscode-ide-companion)
    * [Open VSX Registry](https://open-vsx.org/extension/qwenlm/qwen-code-vscode-ide-companion)

    Or search for "Qwen Code Companion" in VS Code's Extensions panel (`Ctrl+Shift+X` / `Cmd+Shift+X`).
  </Step>

  <Step title="Open the Chat Panel">
    Launch the Qwen Code chat panel using any of these methods:

    * Click the **Qwen icon** in the top-right corner of the editor
    * Run `Qwen Code: Open` from the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`)
  </Step>

  <Step title="Start Chatting">
    Ask Qwen to help with coding tasks:

    ```
    Explain what this project does
    Fix the bug in @src/main.ts
    Write unit tests for @utils/parser.ts
    Refactor this function to be more efficient
    ```
  </Step>
</Steps>

## Usage

### Opening the Chat Panel

Access the Qwen Code chat interface:

1. **Via Editor Icon**: Click the Qwen icon in the editor title bar (top-right)
2. **Via Command Palette**: Press `Ctrl+Shift+P` / `Cmd+Shift+P` and run `Qwen Code: Open`

### Referencing Files

Add files to your conversation context:

* **@-mentions**: Type `@` followed by a filename to reference files in your workspace
* **File picker**: Use the attachment button to select files via the system file picker
* **Images**: Attach screenshots or diagrams to help explain visual issues

### Reviewing Changes

When Qwen suggests code changes:

1. **View diff**: Changes appear in VS Code's native diff view
2. **Edit inline**: Modify the suggested changes directly in the diff editor
3. **Accept**: Click the checkmark icon or press `Ctrl+S` / `Cmd+S` to accept
4. **Reject**: Click the close icon to discard changes

### Auto-Accept Mode

Enable auto-accept to automatically apply changes:

* Changes are applied immediately without manual review
* Useful for rapid prototyping and trusted operations
* Toggle on/off as needed for different workflows

### Multiple Sessions

Run multiple concurrent Qwen Code sessions:

* Each chat panel is independent
* Maintain separate contexts for different tasks
* Review conversation history for each session

## Commands

Available commands in the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`):

| Command                               | Description                                            | Shortcut                               |
| ------------------------------------- | ------------------------------------------------------ | -------------------------------------- |
| `Qwen Code: Open`                     | Open the Qwen Code Chat panel                          | -                                      |
| `Qwen Code: Run`                      | Launch a classic terminal session with the bundled CLI | -                                      |
| `Qwen Code: Accept Current Diff`      | Accept the currently displayed diff                    | `Ctrl+S` / `Cmd+S` (when diff visible) |
| `Qwen Code: Close Diff Editor`        | Close/reject the current diff                          | -                                      |
| `Qwen Code: View Third-Party Notices` | View third-party software notices                      | -                                      |

## Configuration

The extension uses the same configuration as the Qwen Code CLI. Settings are stored in:

* **User settings**: `~/.qwen/settings.json` (global)
* **Project settings**: `.qwen/settings.json` (workspace-specific)

### Configuring Models

Edit your `~/.qwen/settings.json` to configure available models:

```json theme={null}
{
  "modelProviders": {
    "openai": [
      {
        "id": "qwen3-coder-plus",
        "name": "qwen3-coder-plus",
        "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
        "envKey": "DASHSCOPE_API_KEY"
      }
    ]
  },
  "env": {
    "DASHSCOPE_API_KEY": "sk-xxxxxxxxxxxxx"
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "qwen3-coder-plus"
  }
}
```

See the [Configuration Guide](/users/configuration/settings) for all available options.

### VS Code Settings

The extension also respects VS Code's native settings. Access via:

* File → Preferences → Settings (Windows/Linux)
* Code → Settings → Settings (macOS)

Search for "Qwen Code" to see extension-specific settings.

## Using the Bundled CLI

The extension includes a bundled version of the Qwen Code CLI. Access it via:

```bash theme={null}
Qwen Code: Run
```

This launches a terminal session with the bundled CLI, giving you access to:

* All CLI commands and features
* Terminal-based chat interface
* Headless mode for scripting

See the [CLI documentation](/users/overview) for complete usage.

## Keyboard Shortcuts

| Action               | Windows/Linux  | macOS         |
| -------------------- | -------------- | ------------- |
| Open Command Palette | `Ctrl+Shift+P` | `Cmd+Shift+P` |
| Open Extensions      | `Ctrl+Shift+X` | `Cmd+Shift+X` |
| Accept diff          | `Ctrl+S`       | `Cmd+S`       |

## Tips & Best Practices

<AccordionGroup>
  <Accordion title="Use @-mentions for precise context">
    Instead of asking "fix the bug", say "fix the bug in @src/utils/parser.ts:42". This gives Qwen exact context about which file and line you're referring to.
  </Accordion>

  <Accordion title="Review changes before accepting">
    Even with auto-accept mode, periodically review Qwen's suggestions. The diff view makes it easy to verify changes before they're applied.
  </Accordion>

  <Accordion title="Organize with multiple sessions">
    Use separate chat panels for different tasks:

    * One for debugging
    * One for new feature development
    * One for documentation
  </Accordion>

  <Accordion title="Leverage conversation history">
    Previous conversations are saved. Reopen them to:

    * Continue where you left off
    * Reference past solutions
    * Learn from previous interactions
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Extension not appearing">
    **Issue**: Can't find the Qwen icon or commands.

    **Solutions**:

    * Verify the extension is installed and enabled in the Extensions panel
    * Restart VS Code
    * Check VS Code version (requires 1.85.0 or newer)
  </Accordion>

  <Accordion title="Chat panel not opening">
    **Issue**: Clicking the Qwen icon does nothing.

    **Solutions**:

    * Check the Developer Tools for errors (Help → Toggle Developer Tools)
    * Look for extension activation errors in the Output panel (View → Output → Qwen Code)
    * Try reloading the window (Developer: Reload Window)
  </Accordion>

  <Accordion title="Authentication issues">
    **Issue**: Can't sign in or API key not working.

    **Solutions**:

    * Verify your `~/.qwen/settings.json` configuration
    * Check API key validity by running the bundled CLI
    * Ensure network connectivity for OAuth flow
  </Accordion>

  <Accordion title="Diff view not showing changes">
    **Issue**: Suggested changes don't appear.

    **Solutions**:

    * Check that the file is part of your workspace
    * Verify the file isn't excluded by `.gitignore` or VS Code settings
    * Look for errors in the Developer Tools console
  </Accordion>
</AccordionGroup>

### Viewing Logs

To debug issues:

1. **Developer Tools**: Help → Toggle Developer Tools
2. **Output Panel**: View → Output → Select "Qwen Code" from dropdown
3. **Extension Host Log**: Developer: Show Logs → Extension Host

## Compatibility

### VS Code-Based Editors

The extension works with VS Code forks and derivatives:

* **Cursor**: Full compatibility
* **Windsurf**: Full compatibility
* **VSCodium**: Full compatibility via Open VSX
* **Code - OSS**: Full compatibility

### Platform Support

* **Windows**: Windows 10/11
* **macOS**: macOS 10.15 (Catalina) or newer
* **Linux**: Most distributions with glibc 2.28+

## Feedback & Support

<CardGroup cols={2}>
  <Card title="Report Bugs" icon="bug" href="https://github.com/QwenLM/qwen-code/issues/new?template=bug_report.yml&labels=bug,vscode-ide-companion">
    Found an issue? Let us know on GitHub
  </Card>

  <Card title="Request Features" icon="lightbulb" href="https://github.com/QwenLM/qwen-code/issues/new?template=feature_request.yml&labels=enhancement,vscode-ide-companion">
    Have an idea? Submit a feature request
  </Card>

  <Card title="View Changelog" icon="timeline" href="https://github.com/QwenLM/qwen-code/releases">
    See what's new in recent releases
  </Card>

  <Card title="Contributing" icon="code-pull-request" href="https://github.com/QwenLM/qwen-code/blob/main/CONTRIBUTING.md">
    Help improve the extension
  </Card>
</CardGroup>

## Next Steps

* Learn about [configuration options](/users/configuration/settings)
* Explore [CLI commands](/users/features/commands)
* Try [headless mode](/users/features/headless) for automation
* Check out the [TypeScript SDK](https://github.com/QwenLM/qwen-code/tree/main/packages/sdk-typescript) for building on Qwen Code
