Файли
openidea/crates/ide-plugin/tests/fixtures/lsp-requests/plugin.toml
T
Sameh Elhawaryтаsamehelhawary ad236cf1a1 feat(plugins): route a server's client commands to a plugin (serverCommands, API 1.9) (#3597)
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]>
2026-11-16 05:32:06 +08:00

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"