aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-02-27 04:31:41 -0800
committerGitHub <noreply@github.com>2025-02-27 04:31:41 -0800
commit9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9 (patch)
tree7f36fb8b96c77e5a1977bcded49a50355423ec5a
parentrefactor(docgen): use vim.text.indent() #3629 (diff)
downloadnvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.tar
nvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.tar.gz
nvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.tar.bz2
nvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.tar.lz
nvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.tar.xz
nvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.tar.zst
nvim-lspconfig-9dc8ecb488413d879d5d259b1ec66cf0fa7ffbe9.zip
fix(docgen): root_dir doc shows paths from CI env #3630
Problem: When `root_dir` is not defined as a function, the generated docs show the paths resolved in the CI env: root_dir : lua "/home/runner/work/nvim-lspconfig/nvim-lspconfig" Solution: Always show the "gF" message for `root_dir`, even if it is not a function. Fix #3628
-rw-r--r--doc/configs.md10
-rw-r--r--doc/configs.txt10
-rwxr-xr-xscripts/docgen.lua2
3 files changed, 5 insertions, 17 deletions
diff --git a/doc/configs.md b/doc/configs.md
index bba699cd..83743835 100644
--- a/doc/configs.md
+++ b/doc/configs.md
@@ -469,10 +469,7 @@ Default config:
```lua
{ "r" }
```
-- `root_dir` :
- ```lua
- "/home/runner/work/nvim-lspconfig/nvim-lspconfig"
- ```
+- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/air.lua:2](../lua/lspconfig/configs/air.lua#L2)
- `single_file_support` : `true`
@@ -11296,10 +11293,7 @@ Default config:
```lua
{ "html", "ruby", "eruby", "blade", "php" }
```
-- `root_dir` :
- ```lua
- "/home/runner/work/nvim-lspconfig/nvim-lspconfig"
- ```
+- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/turbo_ls.lua:2](../lua/lspconfig/configs/turbo_ls.lua#L2)
## turtle_ls
diff --git a/doc/configs.txt b/doc/configs.txt
index bba699cd..83743835 100644
--- a/doc/configs.txt
+++ b/doc/configs.txt
@@ -469,10 +469,7 @@ Default config:
```lua
{ "r" }
```
-- `root_dir` :
- ```lua
- "/home/runner/work/nvim-lspconfig/nvim-lspconfig"
- ```
+- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/air.lua:2](../lua/lspconfig/configs/air.lua#L2)
- `single_file_support` : `true`
@@ -11296,10 +11293,7 @@ Default config:
```lua
{ "html", "ruby", "eruby", "blade", "php" }
```
-- `root_dir` :
- ```lua
- "/home/runner/work/nvim-lspconfig/nvim-lspconfig"
- ```
+- `root_dir` source (use "gF" to visit): [../lua/lspconfig/configs/turbo_ls.lua:2](../lua/lspconfig/configs/turbo_ls.lua#L2)
## turtle_ls
diff --git a/scripts/docgen.lua b/scripts/docgen.lua
index 04bbd6cc..0de2c047 100755
--- a/scripts/docgen.lua
+++ b/scripts/docgen.lua
@@ -131,7 +131,7 @@ local function make_lsp_sections()
map_sorted(template_def.default_config, function(k, v)
if type(v) == 'boolean' then
return ('- `%s` : `%s`'):format(k, v)
- elseif type(v) ~= 'function' then
+ elseif type(v) ~= 'function' and k ~= 'root_dir' then
return ('- `%s` :\n ```lua\n%s\n ```'):format(k, indent(2, inspect(v)))
end