aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_vimdoc.py
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2023-02-25 16:35:45 +0100
committerGitHub <noreply@github.com>2023-02-25 16:35:45 +0100
commit2708507e877f3255076bab2f5f074667dd25f8fc (patch)
treede1518d17f3890652563ad9c2751879c10b8b5d3 /scripts/gen_vimdoc.py
parentf0f27e9aef7c237dd55fbb5c2cd47c2f42d01742 (diff)
downloadrneovim-2708507e877f3255076bab2f5f074667dd25f8fc.tar.gz
rneovim-2708507e877f3255076bab2f5f074667dd25f8fc.tar.bz2
rneovim-2708507e877f3255076bab2f5f074667dd25f8fc.zip
docs: use build/bin/nvim instead of nvim in gen_vimdoc (#22398)
Problem: `nvim` could point to stable release missing the `nvim -l` functionality. Solution: Require to build nvim first and use `build/bin/nvim`
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-xscripts/gen_vimdoc.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py
index 8e1d6ef80a..b8c36dc35d 100755
--- a/scripts/gen_vimdoc.py
+++ b/scripts/gen_vimdoc.py
@@ -42,6 +42,7 @@ import subprocess
import collections
import msgpack
import logging
+from pathlib import Path
from xml.dom import minidom
@@ -55,19 +56,19 @@ if sys.version_info < MIN_PYTHON_VERSION:
doxygen_version = tuple((int(i) for i in subprocess.check_output(["doxygen", "-v"],
universal_newlines=True).split()[0].split('.')))
-# Until 0.9 is released, need this hacky way to check that "nvim -l foo.lua" works.
-nvim_version = list(line for line in subprocess.check_output(['nvim', '-h'], universal_newlines=True).split('\n')
- if '-l ' in line)
-
if doxygen_version < MIN_DOXYGEN_VERSION:
print("\nRequires doxygen {}.{}.{}+".format(*MIN_DOXYGEN_VERSION))
print("Your doxygen version is {}.{}.{}\n".format(*doxygen_version))
sys.exit(1)
-if len(nvim_version) == 0:
- print("\nRequires 'nvim -l' feature, see https://github.com/neovim/neovim/pull/18706")
+
+# Need a `nvim` that supports `-l`, so use the local build
+nvim = Path(__file__).parent / "../build/bin/nvim"
+if not nvim.exists():
+ print("\nYou need to build Neovim first to build the documentation.")
sys.exit(1)
+
# DEBUG = ('DEBUG' in os.environ)
INCLUDE_C_DECL = ('INCLUDE_C_DECL' in os.environ)
INCLUDE_DEPRECATED = ('INCLUDE_DEPRECATED' in os.environ)
@@ -1163,7 +1164,7 @@ def main(doxygen_config, args):
def filter_source(filename):
name, extension = os.path.splitext(filename)
if extension == '.lua':
- p = subprocess.run(['nvim', '-l', lua2dox, filename], stdout=subprocess.PIPE)
+ p = subprocess.run([str(nvim), '-l', lua2dox, filename], stdout=subprocess.PIPE)
op = ('?' if 0 != p.returncode else p.stdout.decode('utf-8'))
print(op)
else: