diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-07-17 10:39:52 +0100 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-07-17 12:59:06 +0100 |
commit | a54f88ea64c02f9fa7bf3d7445cdaaea424d439f (patch) | |
tree | f2c23577bda50b4845d4694195d5b56e6d5af782 /scripts/gen_vimdoc.py | |
parent | d0b612f360125785eb95afaa51620c5c7695e381 (diff) | |
download | rneovim-a54f88ea64c02f9fa7bf3d7445cdaaea424d439f.tar.gz rneovim-a54f88ea64c02f9fa7bf3d7445cdaaea424d439f.tar.bz2 rneovim-a54f88ea64c02f9fa7bf3d7445cdaaea424d439f.zip |
docs(lua): do not render self args
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-x | scripts/gen_vimdoc.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 8ad6442f3b..6ca330ae22 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -45,6 +45,7 @@ import logging from pathlib import Path from xml.dom import minidom +Element = minidom.Element MIN_PYTHON_VERSION = (3, 6) MIN_DOXYGEN_VERSION = (1, 9, 0) @@ -720,8 +721,7 @@ def para_as_map(parent, indent='', width=text_width - indentation, fmt_vimhelp=F return chunks, xrefs - -def fmt_node_as_vimhelp(parent, width=text_width - indentation, indent='', +def fmt_node_as_vimhelp(parent: Element, width=text_width - indentation, indent='', fmt_vimhelp=False): """Renders (nested) Doxygen <para> nodes as Vim :help text. @@ -734,6 +734,8 @@ def fmt_node_as_vimhelp(parent, width=text_width - indentation, indent='', max_name_len = max_name(m.keys()) + 4 out = '' for name, desc in m.items(): + if name == 'self': + continue name = ' • {}'.format('{{{}}}'.format(name).ljust(max_name_len)) out += '{}{}\n'.format(name, desc) return out.rstrip() @@ -851,6 +853,7 @@ def extract_from_xml(filename, target, width, fmt_vimhelp): and any(x[1] == 'self' for x in params): split_return = return_type.split(' ') name = f'{split_return[1]}:{name}' + params = [x for x in params if x[1] != 'self'] c_args = [] for param_type, param_name in params: |