https://github.com/jdrupal-dev/drupal_ls
The missing language server for Drupal
https://github.com/jdrupal-dev/drupal_ls
Last synced: about 1 year ago
JSON representation
The missing language server for Drupal
- Host: GitHub
- URL: https://github.com/jdrupal-dev/drupal_ls
- Owner: jdrupal-dev
- Created: 2025-01-28T08:45:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-06T13:47:18.000Z (about 1 year ago)
- Last Synced: 2025-03-06T14:42:13.289Z (about 1 year ago)
- Language: Rust
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Drupal LS
The missing language server for Drupal.
WIP!
## Features
### Hover
- Service references
- Service class
- Route references
- Route controller/form
- Hook references
- Permission references
### Go to definition
- Service references
- Service class
- Route references
- Route controller/form
- Hook references
- Permission references
### Completion
- Services
- Routes
- Hook snippets
- General snippets
- Permissions
## Installation
### Neovim installation with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) and lazy.nvim
```lua
{
"jdrupal-dev/drupal_ls",
event = { "BufReadPre", "BufNewFile" },
dependencies = "neovim/nvim-lspconfig",
-- Requires cargo to be installed locally.
build = "cargo build --release",
config = function()
local lspconfig = require("lspconfig")
require("lspconfig.configs").drupal_ls = {
default_config = {
cmd = {
vim.fn.stdpath("data") .. "/lazy/drupal_ls/target/release/drupal_ls",
"--file",
"/tmp/drupal_ls-log.txt",
},
filetypes = { "php", "yaml" },
root_dir = lspconfig.util.root_pattern("composer.json"),
settings = {},
},
}
lspconfig["drupal_ls"].setup({})
end,
}
```
## Roadmap
### Completion
- [ ] Autocomplete plugin IDs (eg. queue workers, blocks, fields, migrate source/process/destination).
- [ ] Autocomplete #theme functions.
### Code actions
- [ ] Generate __construct doc block.
- [ ] Generate t function placeholder array.