You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -32,28 +32,23 @@ There are some additional functionalities, follow the README for them.
32
32
-[Window configuration](#window-configuration)
33
33
-[Filetypes](#filetypes)
34
34
-[Lsp](#lsp)
35
+
-[Using lspcofing](#using-lspcofing)
36
+
-[Using direct call](#using-direct-call)
37
+
-[Codelens](#codelens)
35
38
-[Coexistence with clangd](#coexistence-with-clangd)
36
39
-[NodeTree](#nodetree)
37
-
-[Tests](#tests)
38
-
39
-
**This plugin is only tested by users and not automated tests.**
40
-
**Its features are still a work in progress. They function as intended but the
41
-
API and function signatures may change. Don't get too attached to these**
40
+
-[TODO](#todo)
41
+
-[Preview](#preview)
42
+
-[Tests](#tests)
42
43
43
-
Inspired by [vim-ccls](https://github.com/m-pilia/vim-ccls) by Martin Pilia.
44
-
The entire tree-browser part of the code is a lua rewrite of [vim-yggdrasil](https://github.com/m-pilia/vim-yggdrasil) by Martin Pilia.
45
-
46
-
Features include:
44
+
**Features include**:
47
45
48
46
- Most off-spec `ccls` features
49
47
- Setup lsp either via `lspconfig` or built-in `vim.lsp.start()`
50
48
- Use treesitter to highlight NodeTree window
51
49
- Update tagstack on jump to new node
52
50
- Setup codelens autocmds
53
51
54
-
Soon to be added:
55
-
Add floating previews for each nodes
56
-
57
52
## ccls extensions
58
53
59
54
`ccls` LSP has many off-spec commands/calls. This plugin supports the following
@@ -62,10 +57,6 @@ Add floating previews for each nodes
62
57
63
58
The below functions return a quickfix list of items
64
59
65
-
#### `$ccls/vars`
66
-
67
-
Called via `:CclsVars kind` or `require("ccls").vars(kind)`
68
-
69
60
#### `$ccls/member`
70
61
71
62
Called via `require("ccls").member(kind)`.
@@ -96,6 +87,14 @@ Can also be called via
96
87
-`:CclsBase`
97
88
-`:CclsDerived`
98
89
90
+
#### `$ccls/vars`
91
+
92
+
Called via `:CclsVars kind` or `require("ccls").vars(kind)`.
93
+
This is similar to `textDocument/references` except it checks for the variable
94
+
type.
95
+
Kind values are 1 for all occurence of the variable type, 2 for defintion of
96
+
current variable and 3 for references without definition.
97
+
99
98
### Sidebar or float
100
99
101
100
The following functions are hierarchical and return either a sidebar or a
@@ -216,7 +215,8 @@ initiated_.
216
215
217
216
There are two methods.
218
217
219
-
**Using lspcofing:**
218
+
#### Using lspcofing
219
+
220
220
This requires that you have [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) plugin installed (and already
221
221
loaded if lazy-loading). Pass the appropriate configurations like this.
222
222
@@ -233,7 +233,7 @@ loaded if lazy-loading). Pass the appropriate configurations like this.
233
233
end,
234
234
init_options= { cache= {
235
235
directory=vim.env.XDG_CACHE_HOME.."/ccls/",
236
-
-- or vim.fs.normalize "~/.cache/ccls" -- if on nightly
236
+
-- or vim.fs.normalize "~/.cache/ccls" -- if on nvim 0.8 or higher
237
237
} },
238
238
--on_attach = require("my.attach").func,
239
239
--capabilities = my_caps_table_or_func
@@ -251,14 +251,15 @@ It is also possible to entirely use lspconfig defaults like this:
251
251
require("ccls").setup({lsp= {use_defaults=true}})
252
252
```
253
253
254
-
**Using direct call:**
255
-
If using _nvim nightly_, you can use `vim.lsp.start()` call instead which has the
254
+
#### Using direct call
255
+
256
+
If using _nvim 0.8_, you can use `vim.lsp.start()` call instead which has the
256
257
benefit of reusing the same client on files within the same workspace.
257
258
258
259
To use that, pass this in your config, without supplying the keys `use_defaults`
259
260
or `lspconfig`.
260
261
261
-
**WARNING:** Requires`nvim nightly` or`nvim 0.8`
262
+
**Warning:** Requires `nvim 0.8`
262
263
263
264
<details>
264
265
<summary>Code</summary>
@@ -417,9 +418,21 @@ For now, it works exactly as intended but is not easy read. The code structure i
417
418
to avoid caching problems. Will be modularized when I rewrite the logic.
418
419
-`ccls/tree/utils.lua` has other function calls not part of `tree` or `node` class but necessary
419
420
420
-
## Tests
421
+
## TODO
422
+
423
+
### Preview
424
+
425
+
Open a floating preview window for node under the cursor from Sidebar
426
+
427
+
### Tests
421
428
422
429
This will take some time. Need to figure out how to run a language server for testing.
423
430
I will look through other plugins to see how they handle it. No promise on time.
424
431
425
432
</details>
433
+
434
+
## Credits
435
+
436
+
-[MaskRay](https://github.com/MaskRay) Thank you for creating the LSP!
437
+
-[vim-ccls](https://github.com/m-pilia/vim-ccls) for inspiration and speicifc ideas on translating LSP data into tree-like structure.
438
+
-[vim-yggdrasil](https://github.com/m-pilia/vim-yggdrasil) The entire tree-browser part of the code is a lua rewrite of this plugin.
0 commit comments