Skip to content

Commit a20e7c6

Browse files
committed
merge branch master
2 parents 723eecf + ff41e83 commit a20e7c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+5675
-3559
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
mkdir -p "${DIR_NVIM_SRC}"
8383
curl -L "https://github.com/neovim/neovim/archive/refs/tags/${{ matrix.nvim_version }}.tar.gz" | tar zx --directory "${DIR_NVIM_SRC}/.."
8484
cd "${DIR_NVIM_SRC}"
85-
make
85+
make doc
86+
make lintdoc
8687
8788
- run: make help-check

CONTRIBUTING.md

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ markdown-toc --maxdepth=2 -i CONTRIBUTING.md
1818
* [check](#check)
1919
- [Diagnostics](#diagnostics)
2020
- [Backwards Compatibility](#backwards-compatibility)
21-
- [Documentation](#documentation)
22-
* [Config And Mappings](#config-and-mappings)
23-
* [API](#api)
21+
- [:help Documentation](#help-documentation)
22+
* [Generated Content](#generated-content)
23+
* [Updating And Generating](#updating-and-generating)
24+
* [Checking And Linting](#checking-and-linting)
2425
- [Windows](#windows)
2526
- [Pull Request](#pull-request)
2627
* [Subject](#subject)
@@ -60,7 +61,7 @@ make lint
6061
## style
6162

6263
1. Runs lua language server `codestyle-check` only, using `.luarc.json` settings
63-
1. Runs `scripts/doc-comments.sh` to validate annotated documentation
64+
1. Runs `scripts/doc-comments.sh` to normalise annotated documentation
6465

6566
```sh
6667
make style
@@ -86,11 +87,11 @@ Assumes `$VIMRUNTIME` is `/usr/share/nvim/runtime`. Adjust as necessary e.g.
8687
VIMRUNTIME="/my/path/to/runtime" make check
8788
```
8889

89-
If `lua-language-server` is not available or `--check` doesn't function (e.g. Arch Linux 3.9.1-1) you can manually install it as per `ci.yml` e.g.
90+
If `lua-language-server` is not available or `--check` doesn't function (e.g. Arch Linux 3.9.1-1) you can manually install it as per `ci.yml` using its current `luals_version` e.g.
9091

9192
```sh
9293
mkdir luals
93-
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/3.9.1/lua-language-server-3.9.1-linux-x64.tar.gz" | tar zx --directory luals
94+
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/3.15.0/lua-language-server-3.15.0-linux-x64.tar.gz" | tar zx --directory luals
9495

9596
PATH="luals/bin:${PATH}" make check
9697
```
@@ -119,36 +120,62 @@ else
119120
end
120121
```
121122

122-
# Documentation
123+
# :help Documentation
123124

124-
## Config And Mappings
125+
Please update or add to `doc/nvim-tree-lua.txt` as needed.
125126

126-
When adding to or changing:
127-
1. Default config
128-
2. `config` classes
129-
3. `on_attach` default mappings
127+
## Generated Content
130128

131-
You must generate help documentation. This requires neovim stable sources. You will be promted with instructions on fetching and referencing the source.
129+
`doc/nvim-tree-lua.txt` content starting at `*nvim-tree-config*` will be replaced with generated content. Do not manually edit that content.
130+
131+
### API and Config
132+
133+
Help is generated for:
134+
- `nvim_tree.config` classes from `lua/nvim-tree/_meta/config/`
135+
- `nvim_tree.api` functions from `lua/nvim-tree/_meta/api/`
136+
137+
Please add or update documentation when you make changes, see `:help dev-lua-doc` for docstring format.
138+
139+
`scripts/vimdoc_config.lua` contains the manifest of help sources.
140+
141+
### Config And Mappings
142+
143+
Help is updated for:
144+
- Default keymap at `keymap.on_attach_default`
145+
- Default config at `--- default-config-start`
146+
147+
## Updating And Generating
148+
149+
Nvim sources are required. You will be prompted with instructions on fetching and using the sources.
150+
151+
See comments at the start of each script for complete details.
132152

133153
```sh
134154
make help-update
135155
```
136156

137-
This will:
138-
1. Update config defaults in `*nvim-tree-setup*`
139-
2. Regenerate from `*nvim-tree-config*` to the end of the file, see `gen_vimdoc.sh`
140-
3. Update default mappings in `*nvim-tree-mappings-default*` and `*nvim-tree-quickstart-help*`
157+
- `scripts/help-defaults.sh`
158+
- Update config defaults `*nvim-tree-config-default*`
159+
- Update default mappings:
160+
- `*nvim-tree-mappings-default*`
161+
- `*nvim-tree-quickstart-help*`
162+
163+
- `scripts/vimdoc.sh doc`
164+
- Remove content starting at `*nvim-tree-config*`
165+
- Generate config classes `*nvim-tree-config*`
166+
- Generate API `*nvim-tree-api*`
167+
168+
## Checking And Linting
169+
170+
This is run in CI. Commit or stage your changes and run:
141171

142-
Commit your changes then run:
143172
```sh
144173
make help-check
145174
```
146175

147-
This will re-run `help-update` and check that there are no diffs. It will also lint the documentation, see `lintdoc.sh`
148-
149-
## API
150-
151-
When adding or changing API please update :help nvim-tree-api
176+
- Re-runs `make help-update`
177+
- Checks that `git diff` is empty, to ensure that all content has been generated. This is why a stage or commit is necessary.
178+
- Lints `doc/nvim-tree-lua.txt` using `scripts/vimdoc.sh lintdoc` to check for no broken links etc.
152179

153180
# Windows
154181

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ check: luals
1212
#
1313
# subtasks
1414
#
15-
# TODO #3241 ensure that decorator is checked - all meta should be valid
1615
luacheck:
17-
luacheck --codes --quiet lua --exclude-files "**/_meta/api_decorator.lua"
18-
luacheck --codes --quiet scripts
16+
luacheck --codes --quiet lua --exclude-files "**/_meta/**"
1917

2018
style-check:
2119
scripts/luals-check.sh codestyle-check
@@ -36,15 +34,15 @@ style-fix:
3634
# utility
3735
#
3836
help-update:
39-
scripts/gen_vimdoc.sh
40-
scripts/help-update.sh
37+
scripts/vimdoc.sh doc
38+
scripts/help-defaults.sh
4139

4240
#
4341
# CI
4442
# --ignore-blank-lines is used as nightly has removed unnecessary blank lines that stable (0.11.5) currently inserts
4543
#
4644
help-check: help-update
47-
scripts/lintdoc.sh
45+
scripts/vimdoc.sh lintdoc
4846
git diff --ignore-blank-lines --exit-code doc/nvim-tree-lua.txt
4947

5048

0 commit comments

Comments
 (0)