дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
A language server's code lens, code action or inlay hint can carry a command it leaves to the client. `[[contributes.serverCommands]]` (API 1.9, needs `lsp:<server>`) routes such a command, when no server of the document lists it in `executeCommandProvider`, to the plugin's own command with the arguments as JSON. The first loaded plugin keeps a claimed server + command; the host logs the conflict once. Routed from lsp_execute_command, lsp_apply_code_action and lsp_execute_code_action; a code action's command is matched against its own server's claims only. Part of #3542. Co-authored-by: samehelhawary <[email protected]>
35 рядки
785 B
TOML
35 рядки
785 B
TOML
id = "test.lsp-requests"
|
|
name = "Language server requests fixture"
|
|
version = "0.1.0"
|
|
engines.openidea = "^1.9"
|
|
wasm = "dist/plugin.wasm"
|
|
|
|
[capabilities]
|
|
optional = ["lsp:mock"]
|
|
|
|
[[contributes.commands]]
|
|
id = "request"
|
|
title = "Ask the mock server for its routes"
|
|
|
|
[[contributes.commands]]
|
|
id = "notify"
|
|
title = "Tell the mock server something changed"
|
|
|
|
[[contributes.commands]]
|
|
id = "standard"
|
|
title = "Send a method of LSP itself"
|
|
|
|
[[contributes.commands]]
|
|
id = "ungranted"
|
|
title = "Ask a server the manifest does not name"
|
|
|
|
[[contributes.commands]]
|
|
id = "ran"
|
|
title = "Run a command the mock server left to the client"
|
|
|
|
# The mock server's code lenses carry `mock.modelView` without executing it.
|
|
[[contributes.serverCommands]]
|
|
server = "mock"
|
|
command = "mock.modelView"
|
|
run = "ran"
|