neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 2708507e877f3255076bab2f5f074667dd25f8fc
parent f0f27e9aef7c237dd55fbb5c2cd47c2f42d01742
Author: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Date:   Sat, 25 Feb 2023 16:35:45 +0100

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:
Mscripts/gen_vimdoc.py | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 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: