The missing language server for Drupal.
Hover
- Service references
- Service class
- Route references
- Route controller/form
- Hook references
- Permission references
- Plugin references
Go to definition
- Service references
- Service class
- Route references
- Route controller/form
- Hook references
- Permission references
- Plugin references
Completion
- Services
- Routes
- Snippets
- A few QoL improving snippets.
- Hooks
- form-[ELEMENT]
- render-[ELEMENT]
- Permissions
- Plugin IDs (limited to:)
- EntityType
- QueueWorker
- FieldType
- DataType
- FormElement
- RenderElement
Code actions
- Add translation placeholders to
t()functions.
VSCode
You can download the VSCode extension by searching for drupal-ls in VSCode or going to the marketplace.
Currently the extension is supported on the following platforms:
- MacOS (darwin-x64, darwin-arm64)
- Linux (linux-x64, linux-arm64)
Neovim (lazy.nvim)
You can download a pre-built binary from the Releases page, or you can compile it from source.
{
"jdrupal-dev/drupal_ls",
event = { "BufReadPre", "BufNewFile" },
-- Requires cargo to be installed locally.
-- Only needed when compiling from source.
build = "cargo build --release",
config = function()
vim.lsp.config.drupal_ls = {
cmd = {
-- Replace this path, if you download a prebuilt binary.
vim.fn.stdpath("data") .. "/lazy/drupal_ls/target/release/drupal_ls",
"--file",
"/tmp/drupal_ls-log.txt",
},
filetypes = { "php", "yaml" },
root_markers = {
'composer.json',
},
};
vim.lsp.enable("drupal_ls");
end,
}- Build VSCode extention in Ci.
- Autocomplete #theme functions.
- Generate __construct doc block.