@qwen-code/qwen-code 0.14.0-preview.1 → 0.14.0-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +19 -9
  2. package/bundled/qc-helper/SKILL.md +151 -0
  3. package/bundled/qc-helper/docs/_meta.ts +30 -0
  4. package/bundled/qc-helper/docs/common-workflow.md +571 -0
  5. package/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
  6. package/bundled/qc-helper/docs/configuration/auth.md +366 -0
  7. package/bundled/qc-helper/docs/configuration/memory.md +0 -0
  8. package/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
  9. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
  10. package/bundled/qc-helper/docs/configuration/settings.md +655 -0
  11. package/bundled/qc-helper/docs/configuration/themes.md +160 -0
  12. package/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
  13. package/bundled/qc-helper/docs/extension/_meta.ts +9 -0
  14. package/bundled/qc-helper/docs/extension/extension-releasing.md +121 -0
  15. package/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
  16. package/bundled/qc-helper/docs/extension/introduction.md +310 -0
  17. package/bundled/qc-helper/docs/features/_meta.ts +18 -0
  18. package/bundled/qc-helper/docs/features/approval-mode.md +263 -0
  19. package/bundled/qc-helper/docs/features/arena.md +218 -0
  20. package/bundled/qc-helper/docs/features/channels/_meta.ts +7 -0
  21. package/bundled/qc-helper/docs/features/channels/dingtalk.md +134 -0
  22. package/bundled/qc-helper/docs/features/channels/overview.md +336 -0
  23. package/bundled/qc-helper/docs/features/channels/plugins.md +87 -0
  24. package/bundled/qc-helper/docs/features/channels/telegram.md +120 -0
  25. package/bundled/qc-helper/docs/features/channels/weixin.md +106 -0
  26. package/bundled/qc-helper/docs/features/checkpointing.md +77 -0
  27. package/bundled/qc-helper/docs/features/commands.md +312 -0
  28. package/bundled/qc-helper/docs/features/headless.md +318 -0
  29. package/bundled/qc-helper/docs/features/hooks.md +715 -0
  30. package/bundled/qc-helper/docs/features/language.md +139 -0
  31. package/bundled/qc-helper/docs/features/lsp.md +417 -0
  32. package/bundled/qc-helper/docs/features/mcp.md +281 -0
  33. package/bundled/qc-helper/docs/features/sandbox.md +241 -0
  34. package/bundled/qc-helper/docs/features/skills.md +289 -0
  35. package/bundled/qc-helper/docs/features/sub-agents.md +511 -0
  36. package/bundled/qc-helper/docs/features/token-caching.md +29 -0
  37. package/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
  38. package/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
  39. package/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
  40. package/bundled/qc-helper/docs/integration-github-action.md +241 -0
  41. package/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
  42. package/bundled/qc-helper/docs/integration-vscode.md +39 -0
  43. package/bundled/qc-helper/docs/integration-zed.md +72 -0
  44. package/bundled/qc-helper/docs/overview.md +64 -0
  45. package/bundled/qc-helper/docs/quickstart.md +273 -0
  46. package/bundled/qc-helper/docs/reference/_meta.ts +3 -0
  47. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
  48. package/bundled/qc-helper/docs/support/Uninstall.md +42 -0
  49. package/bundled/qc-helper/docs/support/_meta.ts +6 -0
  50. package/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
  51. package/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
  52. package/cli.js +4530 -3605
  53. package/locales/de.js +2 -2
  54. package/locales/en.js +2 -2
  55. package/locales/ja.js +2 -2
  56. package/locales/pt.js +2 -2
  57. package/locales/ru.js +2 -2
  58. package/locales/zh.js +1 -1
  59. package/package.json +2 -2
@@ -0,0 +1,139 @@
1
+ # Internationalization (i18n) & Language
2
+
3
+ Qwen Code is built for multilingual workflows: it supports UI localization (i18n/l10n) in the CLI, lets you choose the assistant output language, and allows custom UI language packs.
4
+
5
+ ## Overview
6
+
7
+ From a user point of view, Qwen Code’s “internationalization” spans multiple layers:
8
+
9
+ | Capability / Setting | What it controls | Where stored |
10
+ | ------------------------ | ---------------------------------------------------------------------- | ---------------------------- |
11
+ | `/language ui` | Terminal UI text (menus, system messages, prompts) | `~/.qwen/settings.json` |
12
+ | `/language output` | Language the AI responds in (an output preference, not UI translation) | `~/.qwen/output-language.md` |
13
+ | Custom UI language packs | Overrides/extends built-in UI translations | `~/.qwen/locales/*.js` |
14
+
15
+ ## UI Language
16
+
17
+ This is the CLI’s UI localization layer (i18n/l10n): it controls the language of menus, prompts, and system messages.
18
+
19
+ ### Setting the UI Language
20
+
21
+ Use the `/language ui` command:
22
+
23
+ ```bash
24
+ /language ui zh-CN # Chinese
25
+ /language ui en-US # English
26
+ /language ui ru-RU # Russian
27
+ /language ui de-DE # German
28
+ /language ui ja-JP # Japanese
29
+ ```
30
+
31
+ Aliases are also supported:
32
+
33
+ ```bash
34
+ /language ui zh # Chinese
35
+ /language ui en # English
36
+ /language ui ru # Russian
37
+ /language ui de # German
38
+ /language ui ja # Japanese
39
+ ```
40
+
41
+ ### Auto-detection
42
+
43
+ On first startup, Qwen Code detects your system locale and sets the UI language automatically.
44
+
45
+ Detection priority:
46
+
47
+ 1. `QWEN_CODE_LANG` environment variable
48
+ 2. `LANG` environment variable
49
+ 3. System locale via JavaScript Intl API
50
+ 4. Default: English
51
+
52
+ ## LLM Output Language
53
+
54
+ The LLM output language controls what language the AI assistant responds in, regardless of what language you type your questions in.
55
+
56
+ ### How It Works
57
+
58
+ The LLM output language is controlled by a rule file at `~/.qwen/output-language.md`. This file is automatically included in the LLM's context during startup, instructing it to respond in the specified language.
59
+
60
+ ### Auto-detection
61
+
62
+ On first startup, if no `output-language.md` file exists, Qwen Code automatically creates one based on your system locale. For example:
63
+
64
+ - System locale `zh` creates a rule for Chinese responses
65
+ - System locale `en` creates a rule for English responses
66
+ - System locale `ru` creates a rule for Russian responses
67
+ - System locale `de` creates a rule for German responses
68
+ - System locale `ja` creates a rule for Japanese responses
69
+
70
+ ### Manual Setting
71
+
72
+ Use `/language output <language>` to change:
73
+
74
+ ```bash
75
+ /language output Chinese
76
+ /language output English
77
+ /language output Japanese
78
+ /language output German
79
+ ```
80
+
81
+ Any language name works. The LLM will be instructed to respond in that language.
82
+
83
+ > [!note]
84
+ >
85
+ > After changing the output language, restart Qwen Code for the change to take effect.
86
+
87
+ ### File Location
88
+
89
+ ```
90
+ ~/.qwen/output-language.md
91
+ ```
92
+
93
+ ## Configuration
94
+
95
+ ### Via Settings Dialog
96
+
97
+ 1. Run `/settings`
98
+ 2. Find "Language" under General
99
+ 3. Select your preferred UI language
100
+
101
+ ### Via Environment Variable
102
+
103
+ ```bash
104
+ export QWEN_CODE_LANG=zh
105
+ ```
106
+
107
+ This influences auto-detection on first startup (if you haven’t set a UI language and no `output-language.md` file exists yet).
108
+
109
+ ## Custom Language Packs
110
+
111
+ For UI translations, you can create custom language packs in `~/.qwen/locales/`:
112
+
113
+ - Example: `~/.qwen/locales/es.js` for Spanish
114
+ - Example: `~/.qwen/locales/fr.js` for French
115
+
116
+ User directory takes precedence over built-in translations.
117
+
118
+ > [!tip]
119
+ >
120
+ > Contributions are welcome! If you’d like to improve built-in translations or add new languages.
121
+ > For a concrete example, see [PR #1238: feat(i18n): add Russian language support](https://github.com/QwenLM/qwen-code/pull/1238).
122
+
123
+ ### Language Pack Format
124
+
125
+ ```javascript
126
+ // ~/.qwen/locales/es.js
127
+ export default {
128
+ Hello: 'Hola',
129
+ Settings: 'Configuracion',
130
+ // ... more translations
131
+ };
132
+ ```
133
+
134
+ ## Related Commands
135
+
136
+ - `/language` - Show current language settings
137
+ - `/language ui [lang]` - Set UI language
138
+ - `/language output <language>` - Set LLM output language
139
+ - `/settings` - Open settings dialog
@@ -0,0 +1,417 @@
1
+ # Language Server Protocol (LSP) Support
2
+
3
+ Qwen Code provides native Language Server Protocol (LSP) support, enabling advanced code intelligence features like go-to-definition, find references, diagnostics, and code actions. This integration allows the AI agent to understand your code more deeply and provide more accurate assistance.
4
+
5
+ ## Overview
6
+
7
+ LSP support in Qwen Code works by connecting to language servers that understand your code. Once you configure servers via `.lsp.json` (or extensions), Qwen Code can start them and use them to:
8
+
9
+ - Navigate to symbol definitions
10
+ - Find all references to a symbol
11
+ - Get hover information (documentation, type info)
12
+ - View diagnostic messages (errors, warnings)
13
+ - Access code actions (quick fixes, refactorings)
14
+ - Analyze call hierarchies
15
+
16
+ ## Quick Start
17
+
18
+ LSP is an experimental feature in Qwen Code. To enable it, use the `--experimental-lsp` command line flag:
19
+
20
+ ```bash
21
+ qwen --experimental-lsp
22
+ ```
23
+
24
+ LSP servers are configuration-driven. You must define them in `.lsp.json` (or via extensions) for Qwen Code to start them.
25
+
26
+ ### Prerequisites
27
+
28
+ You need to have the language server for your programming language installed:
29
+
30
+ | Language | Language Server | Install Command |
31
+ | --------------------- | -------------------------- | ------------------------------------------------------------------------------ |
32
+ | TypeScript/JavaScript | typescript-language-server | `npm install -g typescript-language-server typescript` |
33
+ | Python | pylsp | `pip install python-lsp-server` |
34
+ | Go | gopls | `go install golang.org/x/tools/gopls@latest` |
35
+ | Rust | rust-analyzer | [Installation guide](https://rust-analyzer.github.io/manual.html#installation) |
36
+ | C/C++ | clangd | Install LLVM/clangd via your package manager |
37
+ | Java | jdtls | Install JDTLS and a JDK |
38
+
39
+ ## Configuration
40
+
41
+ ### .lsp.json File
42
+
43
+ You can configure language servers using a `.lsp.json` file in your project root. This uses the language-keyed format described in the [Claude Code plugin LSP configuration reference](https://code.claude.com/docs/en/plugins-reference#lsp-servers).
44
+
45
+ **Basic format:**
46
+
47
+ ```json
48
+ {
49
+ "typescript": {
50
+ "command": "typescript-language-server",
51
+ "args": ["--stdio"],
52
+ "extensionToLanguage": {
53
+ ".ts": "typescript",
54
+ ".tsx": "typescriptreact",
55
+ ".js": "javascript",
56
+ ".jsx": "javascriptreact"
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ### C/C++ (clangd) configuration
63
+
64
+ Dependencies:
65
+
66
+ - clangd (LLVM) must be installed and available in PATH.
67
+ - A compile database (`compile_commands.json`) or `compile_flags.txt` is required for accurate results.
68
+
69
+ Example:
70
+
71
+ ```json
72
+ {
73
+ "cpp": {
74
+ "command": "clangd",
75
+ "args": [
76
+ "--background-index",
77
+ "--clang-tidy",
78
+ "--header-insertion=iwyu",
79
+ "--completion-style=detailed"
80
+ ]
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### Java (jdtls) configuration
86
+
87
+ Dependencies:
88
+
89
+ - JDK installed and available in PATH (`java`).
90
+ - JDTLS installed and available in PATH (`jdtls`).
91
+
92
+ Example:
93
+
94
+ ```json
95
+ {
96
+ "java": {
97
+ "command": "jdtls",
98
+ "args": ["-configuration", ".jdtls-config", "-data", ".jdtls-workspace"]
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Configuration Options
104
+
105
+ #### Required Fields
106
+
107
+ | Option | Type | Description |
108
+ | --------- | ------ | ------------------------------------------------- |
109
+ | `command` | string | Command to start the LSP server (must be in PATH) |
110
+
111
+ #### Optional Fields
112
+
113
+ | Option | Type | Default | Description |
114
+ | ----------------------- | -------- | --------- | ------------------------------------------------------- |
115
+ | `args` | string[] | `[]` | Command line arguments |
116
+ | `transport` | string | `"stdio"` | Transport type: `stdio`, `tcp`, or `socket` |
117
+ | `env` | object | - | Environment variables |
118
+ | `initializationOptions` | object | - | LSP initialization options |
119
+ | `settings` | object | - | Server settings via `workspace/didChangeConfiguration` |
120
+ | `extensionToLanguage` | object | - | Maps file extensions to language identifiers |
121
+ | `workspaceFolder` | string | - | Override workspace folder (must be within project root) |
122
+ | `startupTimeout` | number | `10000` | Startup timeout in milliseconds |
123
+ | `shutdownTimeout` | number | `5000` | Shutdown timeout in milliseconds |
124
+ | `restartOnCrash` | boolean | `false` | Auto-restart on crash |
125
+ | `maxRestarts` | number | `3` | Maximum restart attempts |
126
+ | `trustRequired` | boolean | `true` | Require trusted workspace |
127
+
128
+ ### TCP/Socket Transport
129
+
130
+ For servers that use TCP or Unix socket transport:
131
+
132
+ ```json
133
+ {
134
+ "remote-lsp": {
135
+ "transport": "tcp",
136
+ "socket": {
137
+ "host": "127.0.0.1",
138
+ "port": 9999
139
+ },
140
+ "extensionToLanguage": {
141
+ ".custom": "custom"
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ## Available LSP Operations
148
+
149
+ Qwen Code exposes LSP functionality through the unified `lsp` tool. Here are the available operations:
150
+
151
+ ### Code Navigation
152
+
153
+ #### Go to Definition
154
+
155
+ Find where a symbol is defined.
156
+
157
+ ```
158
+ Operation: goToDefinition
159
+ Parameters:
160
+ - filePath: Path to the file
161
+ - line: Line number (1-based)
162
+ - character: Column number (1-based)
163
+ ```
164
+
165
+ #### Find References
166
+
167
+ Find all references to a symbol.
168
+
169
+ ```
170
+ Operation: findReferences
171
+ Parameters:
172
+ - filePath: Path to the file
173
+ - line: Line number (1-based)
174
+ - character: Column number (1-based)
175
+ - includeDeclaration: Include the declaration itself (optional)
176
+ ```
177
+
178
+ #### Go to Implementation
179
+
180
+ Find implementations of an interface or abstract method.
181
+
182
+ ```
183
+ Operation: goToImplementation
184
+ Parameters:
185
+ - filePath: Path to the file
186
+ - line: Line number (1-based)
187
+ - character: Column number (1-based)
188
+ ```
189
+
190
+ ### Symbol Information
191
+
192
+ #### Hover
193
+
194
+ Get documentation and type information for a symbol.
195
+
196
+ ```
197
+ Operation: hover
198
+ Parameters:
199
+ - filePath: Path to the file
200
+ - line: Line number (1-based)
201
+ - character: Column number (1-based)
202
+ ```
203
+
204
+ #### Document Symbols
205
+
206
+ Get all symbols in a document.
207
+
208
+ ```
209
+ Operation: documentSymbol
210
+ Parameters:
211
+ - filePath: Path to the file
212
+ ```
213
+
214
+ #### Workspace Symbol Search
215
+
216
+ Search for symbols across the workspace.
217
+
218
+ ```
219
+ Operation: workspaceSymbol
220
+ Parameters:
221
+ - query: Search query string
222
+ - limit: Maximum results (optional)
223
+ ```
224
+
225
+ ### Call Hierarchy
226
+
227
+ #### Prepare Call Hierarchy
228
+
229
+ Get the call hierarchy item at a position.
230
+
231
+ ```
232
+ Operation: prepareCallHierarchy
233
+ Parameters:
234
+ - filePath: Path to the file
235
+ - line: Line number (1-based)
236
+ - character: Column number (1-based)
237
+ ```
238
+
239
+ #### Incoming Calls
240
+
241
+ Find all functions that call the given function.
242
+
243
+ ```
244
+ Operation: incomingCalls
245
+ Parameters:
246
+ - callHierarchyItem: Item from prepareCallHierarchy
247
+ ```
248
+
249
+ #### Outgoing Calls
250
+
251
+ Find all functions called by the given function.
252
+
253
+ ```
254
+ Operation: outgoingCalls
255
+ Parameters:
256
+ - callHierarchyItem: Item from prepareCallHierarchy
257
+ ```
258
+
259
+ ### Diagnostics
260
+
261
+ #### File Diagnostics
262
+
263
+ Get diagnostic messages (errors, warnings) for a file.
264
+
265
+ ```
266
+ Operation: diagnostics
267
+ Parameters:
268
+ - filePath: Path to the file
269
+ ```
270
+
271
+ #### Workspace Diagnostics
272
+
273
+ Get all diagnostic messages across the workspace.
274
+
275
+ ```
276
+ Operation: workspaceDiagnostics
277
+ Parameters:
278
+ - limit: Maximum results (optional)
279
+ ```
280
+
281
+ ### Code Actions
282
+
283
+ #### Get Code Actions
284
+
285
+ Get available code actions (quick fixes, refactorings) at a location.
286
+
287
+ ```
288
+ Operation: codeActions
289
+ Parameters:
290
+ - filePath: Path to the file
291
+ - line: Start line number (1-based)
292
+ - character: Start column number (1-based)
293
+ - endLine: End line number (optional, defaults to line)
294
+ - endCharacter: End column (optional, defaults to character)
295
+ - diagnostics: Diagnostics to get actions for (optional)
296
+ - codeActionKinds: Filter by action kind (optional)
297
+ ```
298
+
299
+ Code action kinds:
300
+
301
+ - `quickfix` - Quick fixes for errors/warnings
302
+ - `refactor` - Refactoring operations
303
+ - `refactor.extract` - Extract to function/variable
304
+ - `refactor.inline` - Inline function/variable
305
+ - `source` - Source code actions
306
+ - `source.organizeImports` - Organize imports
307
+ - `source.fixAll` - Fix all auto-fixable issues
308
+
309
+ ## Security
310
+
311
+ LSP servers are only started in trusted workspaces by default. This is because language servers run with your user permissions and can execute code.
312
+
313
+ ### Trust Controls
314
+
315
+ - **Trusted Workspace**: LSP servers start if configured
316
+ - **Untrusted Workspace**: LSP servers won't start unless `trustRequired: false` is set in the server configuration
317
+
318
+ To mark a workspace as trusted, use the `/trust` command or configure trusted folders in settings.
319
+
320
+ ### Per-Server Trust Override
321
+
322
+ You can override trust requirements for specific servers in their configuration:
323
+
324
+ ```json
325
+ {
326
+ "safe-server": {
327
+ "command": "safe-language-server",
328
+ "args": ["--stdio"],
329
+ "trustRequired": false,
330
+ "extensionToLanguage": {
331
+ ".safe": "safe"
332
+ }
333
+ }
334
+ }
335
+ ```
336
+
337
+ ## Troubleshooting
338
+
339
+ ### Server Not Starting
340
+
341
+ 1. **Check if the server is installed**: Run the command manually to verify
342
+ 2. **Check the PATH**: Ensure the server binary is in your system PATH
343
+ 3. **Check workspace trust**: The workspace must be trusted for LSP
344
+ 4. **Check logs**: Look for error messages in the console output
345
+ 5. **Verify --experimental-lsp flag**: Make sure you're using the flag when starting Qwen Code
346
+
347
+ ### Slow Performance
348
+
349
+ 1. **Large projects**: Consider excluding `node_modules` and other large directories
350
+ 2. **Server timeout**: Increase `startupTimeout` in server configuration for slow servers
351
+
352
+ ### No Results
353
+
354
+ 1. **Server not ready**: The server may still be indexing
355
+ 2. **File not saved**: Save your file for the server to pick up changes
356
+ 3. **Wrong language**: Check if the correct server is running for your language
357
+
358
+ ### Debugging
359
+
360
+ Enable debug logging to see LSP communication:
361
+
362
+ ```bash
363
+ DEBUG=lsp* qwen --experimental-lsp
364
+ ```
365
+
366
+ Or check the LSP debugging guide at `packages/cli/LSP_DEBUGGING_GUIDE.md`.
367
+
368
+ ## Claude Code Compatibility
369
+
370
+ Qwen Code supports Claude Code-style `.lsp.json` configuration files in the language-keyed format defined in the [Claude Code plugins reference](https://code.claude.com/docs/en/plugins-reference#lsp-servers). If you're migrating from Claude Code, use the language-as-key layout in your configuration.
371
+
372
+ ### Configuration Format
373
+
374
+ The recommended format follows Claude Code's specification:
375
+
376
+ ```json
377
+ {
378
+ "go": {
379
+ "command": "gopls",
380
+ "args": ["serve"],
381
+ "extensionToLanguage": {
382
+ ".go": "go"
383
+ }
384
+ }
385
+ }
386
+ ```
387
+
388
+ Claude Code LSP plugins can also supply `lspServers` in `plugin.json` (or a referenced `.lsp.json`). Qwen Code loads those configs when the extension is enabled, and they must use the same language-keyed format.
389
+
390
+ ## Best Practices
391
+
392
+ 1. **Install language servers globally**: This ensures they're available in all projects
393
+ 2. **Use project-specific settings**: Configure server options per project when needed via `.lsp.json`
394
+ 3. **Keep servers updated**: Update your language servers regularly for best results
395
+ 4. **Trust wisely**: Only trust workspaces from trusted sources
396
+
397
+ ## FAQ
398
+
399
+ ### Q: How do I enable LSP?
400
+
401
+ Use the `--experimental-lsp` flag when starting Qwen Code:
402
+
403
+ ```bash
404
+ qwen --experimental-lsp
405
+ ```
406
+
407
+ ### Q: How do I know which language servers are running?
408
+
409
+ Use the `/lsp status` command to see all configured and running language servers.
410
+
411
+ ### Q: Can I use multiple language servers for the same file type?
412
+
413
+ Yes, but only one will be used for each operation. The first server that returns results wins.
414
+
415
+ ### Q: Does LSP work in sandbox mode?
416
+
417
+ LSP servers run outside the sandbox to access your code. They're subject to workspace trust controls.