Skip to content

Commit 37c772b

Browse files
committed
chore(cleanup): Update README
1 parent 3a58ddd commit 37c772b

File tree

1 file changed

+36
-23
lines changed

1 file changed

+36
-23
lines changed

README.md

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ There are some additional functionalities, follow the README for them.
2020

2121
- [ccls extensions](#ccls-extensions)
2222
- [Quickfix](#quickfix)
23-
- [`$ccls/vars`](#cclsvars)
2423
- [`$ccls/member`](#cclsmember)
2524
- [`$ccls/call`](#cclscall)
2625
- [`$ccls/inheritance`](#cclsinheritance)
26+
- [`$ccls/vars`](#cclsvars)
2727
- [Sidebar or float](#sidebar-or-float)
2828
- [`$ccls/member` hierarchy](#cclsmember-hierarchy)
2929
- [`$ccls/call` hierarchy](#cclscall-hierarchy)
@@ -32,28 +32,23 @@ There are some additional functionalities, follow the README for them.
3232
- [Window configuration](#window-configuration)
3333
- [Filetypes](#filetypes)
3434
- [Lsp](#lsp)
35+
- [Using lspcofing](#using-lspcofing)
36+
- [Using direct call](#using-direct-call)
37+
- [Codelens](#codelens)
3538
- [Coexistence with clangd](#coexistence-with-clangd)
3639
- [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)
4243

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**:
4745

4846
- Most off-spec `ccls` features
4947
- Setup lsp either via `lspconfig` or built-in `vim.lsp.start()`
5048
- Use treesitter to highlight NodeTree window
5149
- Update tagstack on jump to new node
5250
- Setup codelens autocmds
5351

54-
Soon to be added:
55-
Add floating previews for each nodes
56-
5752
## ccls extensions
5853

5954
`ccls` LSP has many off-spec commands/calls. This plugin supports the following
@@ -62,10 +57,6 @@ Add floating previews for each nodes
6257

6358
The below functions return a quickfix list of items
6459

65-
#### `$ccls/vars`
66-
67-
Called via `:CclsVars kind` or `require("ccls").vars(kind)`
68-
6960
#### `$ccls/member`
7061

7162
Called via `require("ccls").member(kind)`.
@@ -96,6 +87,14 @@ Can also be called via
9687
- `:CclsBase`
9788
- `:CclsDerived`
9889

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+
9998
### Sidebar or float
10099

101100
The following functions are hierarchical and return either a sidebar or a
@@ -216,7 +215,8 @@ initiated_.
216215

217216
There are two methods.
218217

219-
**Using lspcofing:**
218+
#### Using lspcofing
219+
220220
This requires that you have [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) plugin installed (and already
221221
loaded if lazy-loading). Pass the appropriate configurations like this.
222222

@@ -233,7 +233,7 @@ loaded if lazy-loading). Pass the appropriate configurations like this.
233233
end,
234234
init_options = { cache = {
235235
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
237237
} },
238238
--on_attach = require("my.attach").func,
239239
--capabilities = my_caps_table_or_func
@@ -251,14 +251,15 @@ It is also possible to entirely use lspconfig defaults like this:
251251
require("ccls").setup({lsp = {use_defaults = true}})
252252
```
253253

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
256257
benefit of reusing the same client on files within the same workspace.
257258

258259
To use that, pass this in your config, without supplying the keys `use_defaults`
259260
or `lspconfig`.
260261

261-
**WARNING:** Requires `nvim nightly` or `nvim 0.8`
262+
**Warning:** Requires `nvim 0.8`
262263

263264
<details>
264265
<summary>Code</summary>
@@ -417,9 +418,21 @@ For now, it works exactly as intended but is not easy read. The code structure i
417418
to avoid caching problems. Will be modularized when I rewrite the logic.
418419
- `ccls/tree/utils.lua` has other function calls not part of `tree` or `node` class but necessary
419420

420-
## Tests
421+
## TODO
422+
423+
### Preview
424+
425+
Open a floating preview window for node under the cursor from Sidebar
426+
427+
### Tests
421428

422429
This will take some time. Need to figure out how to run a language server for testing.
423430
I will look through other plugins to see how they handle it. No promise on time.
424431

425432
</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

Comments
 (0)