@qwen-code/qwen-code 0.15.5 → 0.15.6
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.
- package/bundled/qc-helper/docs/features/lsp.md +30 -34
- package/cli.js +3232 -2927
- package/locales/ca.js +1 -0
- package/locales/de.js +1 -0
- package/locales/en.js +1 -0
- package/locales/fr.js +1 -0
- package/locales/ja.js +2 -0
- package/locales/pt.js +1 -0
- package/locales/ru.js +1 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +2 -2
|
@@ -40,7 +40,7 @@ You need to have the language server for your programming language installed:
|
|
|
40
40
|
|
|
41
41
|
### .lsp.json File
|
|
42
42
|
|
|
43
|
-
You can configure language servers using a `.lsp.json` file in your project root.
|
|
43
|
+
You can configure language servers using a `.lsp.json` file in your project root. Each top-level key is a language identifier, and its value is the server configuration object.
|
|
44
44
|
|
|
45
45
|
**Basic format:**
|
|
46
46
|
|
|
@@ -104,9 +104,9 @@ Example:
|
|
|
104
104
|
|
|
105
105
|
#### Required Fields
|
|
106
106
|
|
|
107
|
-
| Option | Type | Description
|
|
108
|
-
| --------- | ------ |
|
|
109
|
-
| `command` | string | Command to start the LSP server
|
|
107
|
+
| Option | Type | Description |
|
|
108
|
+
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
109
|
+
| `command` | string | Command to start the LSP server. Supports bare command names resolved via `PATH` (e.g. `clangd`) and absolute paths (e.g. `/opt/llvm/bin/clangd`) |
|
|
110
110
|
|
|
111
111
|
#### Optional Fields
|
|
112
112
|
|
|
@@ -148,6 +148,8 @@ For servers that use TCP or Unix socket transport:
|
|
|
148
148
|
|
|
149
149
|
Qwen Code exposes LSP functionality through the unified `lsp` tool. Here are the available operations:
|
|
150
150
|
|
|
151
|
+
Location-based operations (`goToDefinition`, `findReferences`, `hover`, `goToImplementation`, and `prepareCallHierarchy`) require an exact `filePath` + `line` + `character` position. If you do not know the exact position, use `workspaceSymbol` or `documentSymbol` first to locate the symbol.
|
|
152
|
+
|
|
151
153
|
### Code Navigation
|
|
152
154
|
|
|
153
155
|
#### Go to Definition
|
|
@@ -315,7 +317,7 @@ LSP servers are only started in trusted workspaces by default. This is because l
|
|
|
315
317
|
- **Trusted Workspace**: LSP servers start if configured
|
|
316
318
|
- **Untrusted Workspace**: LSP servers won't start unless `trustRequired: false` is set in the server configuration
|
|
317
319
|
|
|
318
|
-
To mark a workspace as trusted, use the `/trust` command
|
|
320
|
+
To mark a workspace as trusted, use the `/trust` command.
|
|
319
321
|
|
|
320
322
|
### Per-Server Trust Override
|
|
321
323
|
|
|
@@ -338,11 +340,12 @@ You can override trust requirements for specific servers in their configuration:
|
|
|
338
340
|
|
|
339
341
|
### Server Not Starting
|
|
340
342
|
|
|
341
|
-
1. **
|
|
342
|
-
2. **Check the
|
|
343
|
-
3. **Check
|
|
344
|
-
4. **Check
|
|
345
|
-
5. **
|
|
343
|
+
1. **Verify `--experimental-lsp` flag**: Make sure you're using the flag when starting Qwen Code
|
|
344
|
+
2. **Check if the server is installed**: Run the command manually (e.g. `clangd --version`) to verify
|
|
345
|
+
3. **Check the command**: The server binary must be in your system `PATH`, or specified as an absolute path (e.g. `/opt/llvm/bin/clangd`). Relative paths that escape the workspace are blocked
|
|
346
|
+
4. **Check workspace trust**: The workspace must be trusted for LSP (use `/trust`)
|
|
347
|
+
5. **Check logs**: Look for `[LSP]` entries in the debug log (see Debugging section below)
|
|
348
|
+
6. **Check the process**: Run `ps aux | grep <server-name>` to verify the server process is running
|
|
346
349
|
|
|
347
350
|
### Slow Performance
|
|
348
351
|
|
|
@@ -351,41 +354,34 @@ You can override trust requirements for specific servers in their configuration:
|
|
|
351
354
|
|
|
352
355
|
### No Results
|
|
353
356
|
|
|
354
|
-
1. **Server not ready**: The server may still be indexing
|
|
357
|
+
1. **Server not ready**: The server may still be indexing. For C/C++ projects with clangd, ensure `--background-index` is in the args and a `compile_commands.json` (or `compile_flags.txt`) exists in the project root or a parent directory. Use `--compile-commands-dir=<path>` if it is in a build subdirectory
|
|
355
358
|
2. **File not saved**: Save your file for the server to pick up changes
|
|
356
359
|
3. **Wrong language**: Check if the correct server is running for your language
|
|
360
|
+
4. **Check the process**: Run `ps aux | grep <server-name>` to verify the server is actually running
|
|
357
361
|
|
|
358
362
|
### Debugging
|
|
359
363
|
|
|
360
|
-
|
|
364
|
+
LSP debug logs are automatically written to session log files in `~/.qwen/debug/`. To check LSP-related entries:
|
|
361
365
|
|
|
362
366
|
```bash
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
Or check the LSP debugging guide at `packages/cli/LSP_DEBUGGING_GUIDE.md`.
|
|
367
|
-
|
|
368
|
-
## Claude Code Compatibility
|
|
367
|
+
# View the latest session log
|
|
368
|
+
grep '\[LSP\]' ~/.qwen/debug/latest
|
|
369
369
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
# Common error messages to look for:
|
|
371
|
+
# "command path is unsafe" → relative path escapes workspace, use absolute path or add to PATH
|
|
372
|
+
# "command not found" → server binary not installed or not in PATH
|
|
373
|
+
# "requires trusted workspace" → run /trust first
|
|
374
|
+
```
|
|
373
375
|
|
|
374
|
-
|
|
376
|
+
You can also verify the server process is running:
|
|
375
377
|
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
"go": {
|
|
379
|
-
"command": "gopls",
|
|
380
|
-
"args": ["serve"],
|
|
381
|
-
"extensionToLanguage": {
|
|
382
|
-
".go": "go"
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
378
|
+
```bash
|
|
379
|
+
ps aux | grep clangd # or typescript-language-server, jdtls, etc.
|
|
386
380
|
```
|
|
387
381
|
|
|
388
|
-
|
|
382
|
+
## Extension LSP Configuration
|
|
383
|
+
|
|
384
|
+
Extensions can provide LSP server configurations through the `lspServers` field in their `plugin.json`. This can be either an inline object or a path to a `.lsp.json` file. Qwen Code loads these configs when the extension is enabled. The format is the same language-keyed layout used in project `.lsp.json` files.
|
|
389
385
|
|
|
390
386
|
## Best Practices
|
|
391
387
|
|
|
@@ -406,7 +402,7 @@ qwen --experimental-lsp
|
|
|
406
402
|
|
|
407
403
|
### Q: How do I know which language servers are running?
|
|
408
404
|
|
|
409
|
-
|
|
405
|
+
Check the debug log for `[LSP]` entries (`grep '\[LSP\]' ~/.qwen/debug/latest`), or verify the process directly with `ps aux | grep <server-name>`.
|
|
410
406
|
|
|
411
407
|
### Q: Can I use multiple language servers for the same file type?
|
|
412
408
|
|