This document lists the custom LSP commands and notifications provided by the Shopware Language Server. Each entry shows the method name, expected parameters and a short description of the action that is executed.
- Parameters: none
- Action: Forces a rebuild of all indexes by invoking
indexAllwithforceReindexset totrue. - Returns:
{ "message": "Force reindexing started" }
- Parameters: none
- Action: Returns all detected Shopware extensions via the
ExtensionIndexer. - Returns: array of objects with
Name,TypeandPathfields.
- Parameters:
{ "fileUri": string } - Action: Searches the snippet directory for JSON files or creates a default
storefront.en-GB.jsonif none exist. - Returns:
{ "paths": [ { "path": string, "name": string, "value": string } ] }
- Parameters:
{ "fileUri": string, "snippetKey": string, "snippets": [ { "path": string, "name": string, "value": string } ] } - Action: Adds the provided snippet value to the given JSON files, reindexes them and publishes diagnostics for the original document.
- Returns:
null
- Parameters: none
- Action: Collects all storefront snippet keys from the indexed snippet files.
- Returns: array of objects
{ key, text, file }sorted alphabetically.
- Parameters:
{ "fileUri": string } - Action: Searches the administration snippet directory for JSON files or creates a default structure if none exist.
- Returns:
{ "paths": [ { "path": string, "name": string, "value": string } ] }
- Parameters:
{ "fileUri": string, "snippetKey": string, "snippets": [ { "path": string, "name": string, "value": string } ] } - Action: Adds the provided snippet value to the given admin JSON files, reindexes them and publishes diagnostics for the original document.
- Returns:
null
- Parameters: none
- Action: Collects all admin snippet keys from the indexed snippet files.
- Returns: array of objects
{ key, text, file }sorted alphabetically.
- Parameters:
{ "textUri": string, "blockName": string, "extension": string } - Action: Creates or updates a Twig template in the selected extension so that it extends the given block. A new file is created if necessary and the block is inserted.
- Returns: on success
{ "uri": string, "line": number }; otherwise an error object withcodeandmessage.
Sent when the server begins indexing. No parameters are required.
Sent when indexing finishes. Parameters:
{ "message": string, "timeInSeconds": number }The server produces a single binary. Build it using:
go build -o shopware-lspIn Neovim, configure the language server using lspconfig:
require('lspconfig').shopware_lsp = {
default_config = {
cmd = { '/path/to/shopware-lsp' },
filetypes = { 'php', 'twig', 'xml', 'yaml' },
root_dir = vim.loop.cwd,
},
}
require('lspconfig')['shopware_lsp'].setup{}This registers the binary with Neovim’s built‑in LSP client and enables the custom commands above via vim.lsp.buf.execute_command or client.request.