mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	gen_vimdoc.py: mpack: collect functions in 1 dict
All Nvim API, core Vimscript, and core Lua functions are globally
unique, so there is no need for per-module nested dicts.
BEFORE (generated mpack structure):
    [
      {
        "buffer.c": {
          "nvim__buf_stats": { ... },
          ...
        },
        "window.c": {
          "nvim_win_close": { ... },
          ...
        },
        ...
      }
    ]
AFTER (generated mpack structure):
    [
      {
        "nvim__buf_stats": {
          ...
        },
        "nvim_buf_attach": {
          ...
        },
        "nvim_tabpage_set_var": {
          ...
        },
        "nvim_ui_attach": {
          ...
        },
        "nvim_win_close": {
          ...
        }
      }
    ]
			
			
This commit is contained in:
		| @@ -729,7 +729,7 @@ def gen_docs(config): | |||||||
|         if p.returncode: |         if p.returncode: | ||||||
|             sys.exit(p.returncode) |             sys.exit(p.returncode) | ||||||
|  |  | ||||||
|         fn_maps = {} |         fn_map_full = {}  # Collects all functions as each module is processed. | ||||||
|         sections = {} |         sections = {} | ||||||
|         intros = {} |         intros = {} | ||||||
|         sep = '=' * text_width |         sep = '=' * text_width | ||||||
| @@ -800,7 +800,7 @@ def gen_docs(config): | |||||||
|                             title = '{} Functions'.format(name) |                             title = '{} Functions'.format(name) | ||||||
|                             helptag = '*api-{}*'.format(name.lower()) |                             helptag = '*api-{}*'.format(name.lower()) | ||||||
|                         sections[filename] = (title, helptag, doc) |                         sections[filename] = (title, helptag, doc) | ||||||
|                         fn_maps[filename] = fn_map |                         fn_map_full.update(fn_map) | ||||||
|  |  | ||||||
|         if not sections: |         if not sections: | ||||||
|             return |             return | ||||||
| @@ -833,7 +833,7 @@ def gen_docs(config): | |||||||
|             fp.write(docs.encode('utf8')) |             fp.write(docs.encode('utf8')) | ||||||
|  |  | ||||||
|         with open(mpack_file, 'wb') as fp: |         with open(mpack_file, 'wb') as fp: | ||||||
|             fp.write(msgpack.packb(fn_maps, use_bin_type=True)) |             fp.write(msgpack.packb(fn_map_full, use_bin_type=True)) | ||||||
|  |  | ||||||
|         shutil.rmtree(output_dir) |         shutil.rmtree(output_dir) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Justin M. Keyes
					Justin M. Keyes