Skip to content

Commit 30237ad

Browse files
committed
docs: Update README.md
1 parent 2e6db26 commit 30237ad

1 file changed

Lines changed: 49 additions & 21 deletions

File tree

README.md

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,36 @@
22
The missing language server for Drupal.
33

44
## Features
5-
### Hover
5+
<details>
6+
7+
<summary>Hover</summary>
8+
69
- Service references
710
- Service class
811
- Route references
912
- Route controller/form
1013
- Hook references
1114
- Permission references
1215
- Plugin references
13-
### Go to definition
16+
17+
</details>
18+
<details>
19+
20+
<summary>Go to definition</summary>
21+
1422
- Service references
1523
- Service class
1624
- Route references
1725
- Route controller/form
1826
- Hook references
1927
- Permission references
2028
- Plugin references
21-
### Completion
29+
30+
</details>
31+
<details>
32+
33+
<summary>Completion</summary>
34+
2235
- Services
2336
- Routes
2437
- Snippets
@@ -34,48 +47,63 @@ The missing language server for Drupal.
3447
- DataType
3548
- FormElement
3649
- RenderElement
37-
### Code actions
50+
51+
</details>
52+
<details>
53+
54+
<summary>Code actions</summary>
55+
3856
- Add translation placeholders to `t()` functions.
3957

58+
</details>
59+
4060
## Installation
61+
<details>
62+
63+
<summary>VSCode</summary>
4164

42-
### VSCode extension available in marketplace
4365
You can download the VSCode extension by searching for `drupal-ls` in VSCode or going to [the marketplace](https://marketplace.visualstudio.com/items?itemName=jdrupal-dev.drupal-ls).
4466

4567
Currently the extension is supported on the following platforms:
4668
- MacOS (darwin-x64, darwin-arm64)
4769
- Linux (linux-x64, linux-arm64)
4870

49-
### Neovim installation with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) and lazy.nvim
71+
</details>
72+
73+
<details>
74+
75+
<summary>Neovim (lazy.nvim)</summary>
76+
77+
You can download a pre-built binary from the Releases page, or you can compile it from source.
5078

5179
```lua
5280
{
5381
"jdrupal-dev/drupal_ls",
5482
event = { "BufReadPre", "BufNewFile" },
55-
dependencies = "neovim/nvim-lspconfig",
5683
-- Requires cargo to be installed locally.
84+
-- Only needed when compiling from source.
5785
build = "cargo build --release",
5886
config = function()
59-
local lspconfig = require("lspconfig")
60-
61-
require("lspconfig.configs").drupal_ls = {
62-
default_config = {
63-
cmd = {
64-
vim.fn.stdpath("data") .. "/lazy/drupal_ls/target/release/drupal_ls",
65-
"--file",
66-
"/tmp/drupal_ls-log.txt",
67-
},
68-
filetypes = { "php", "yaml" },
69-
root_dir = lspconfig.util.root_pattern("composer.json"),
70-
settings = {},
87+
vim.lsp.config.drupal_ls = {
88+
cmd = {
89+
-- Replace this path, if you download a prebuilt binary.
90+
vim.fn.stdpath("data") .. "/lazy/drupal_ls/target/release/drupal_ls",
91+
"--file",
92+
"/tmp/drupal_ls-log.txt",
7193
},
72-
}
94+
filetypes = { "php", "yaml" },
95+
root_markers = {
96+
'composer.json',
97+
},
98+
};
7399

74-
lspconfig["drupal_ls"].setup({})
100+
vim.lsp.enable("drupal_ls");
75101
end,
76102
}
77103
```
78104

105+
</details>
106+
79107
## Roadmap
80108
### VSCode
81109
- [ ] Build VSCode extention in Ci.

0 commit comments

Comments
 (0)