Commit Graph

835 Commits

Author SHA1 Message Date
Jongwook Choi 878dcf1980 docs(gen_help_html.lua): handle modeline and note nodes
Problem:

'modeline' and 'note' are unhandled in the online HTML documentation.

Some (not all) modelines are parsed by the vimdoc parser as a node of
type 'modeline'.

Solution:

- Ignore 'modeline' in HTML rendering.
- Render 'note' text in boldface.
2024-05-17 08:18:01 +02:00
Justin M. Keyes 31dc627969
docs: news #28773 2024-05-16 06:28:27 -07:00
Justin M. Keyes 668b5fc155
docs: nvim.appdata.xml, set faq to "flow" layout #28769 2024-05-16 01:53:33 -07:00
Jongwook Choi 174da7fe68 docs(gen_help_html.lua): fix broken pre text, and handle linewrap
Problem:

- Since #28678, pre-formatted text in the online documentation do not
  render whitespaces correctly: should be pre-like text, but shown like
  normal paragraph (see #28754).

- Code blocks with long lines should not be wrapped (e.g. see
  |dev-vimpatch-list-management|).

Solution:

- Use `white-space: pre-wrap`. Compared to `white-space: pre`, this
  option will make long lines including a very long URL wrapped.
  This properly fixes #28754 and #28678.

- Use horizontal scrollbar for the code blocks that are horizontally too
  long, instead of wrapping text. This will make the code easy to read
  while the pre-text block not interfering with the navigation bar.
2024-05-16 09:01:05 +02:00
zeertzjq 9ca81b0259
build(release.sh): set VIMRUNTIME when regenerating docs (#28765) 2024-05-16 07:21:19 +08:00
Justin M. Keyes 4399c4932d build(release.sh): use git cliff, drop old script 2024-05-16 00:19:17 +02:00
Justin M. Keyes 54044e6dce fix(release.sh): ze version is too big 2024-05-16 00:19:17 +02:00
Justin M. Keyes 01b6bff7e9 docs: news
Set dev_xx.txt help files to use "flow" layout.
2024-05-15 23:19:26 +02:00
zeertzjq ffb4b50e74
docs(lua): restore missing indexing for vim.bo and vim.wo (#28751) 2024-05-15 19:39:35 +08:00
gusain71 ebba7ae095
docs(gen_help_html.lua): wrap legacy help at word-boundary #28678
Problem:
On the page: https://neovim.io/doc/user/dev_vimpatch.html
The links extend beyond the container and thus end up behind the navigation to the right.

Solution:
Add these lines to get_help_html.lua:

    white-space: normal;
    word-wrap: break-word;
2024-05-14 04:23:43 -07:00
zeertzjq 7a03cd1dba
vim-patch:1c5728e0c4a9 (#28703)
runtime(doc): update and remove  some invalid links

closes: vim/vim#14748

1c5728e0c4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-11 18:14:03 +08:00
zeertzjq 854c362cc8
vim-patch:b23c1fc59650 (#28702)
runtime(doc): Add Makefile for the Vim documentation on Windows (vim/vim#13467)

* Makefile for the Vim documentation on Windows

* Corrected comments

b23c1fc596

Co-authored-by: Restorer <69863286+RestorerZ@users.noreply.github.com>
2024-05-11 17:43:23 +08:00
James Trew 93940af1d4 docs(luacats): support backtick captured generic type
Problem:
While LuaCATS's generics system are still considered WIP by luals, they
currently support type captured generics.

See "Capture with Backtick" example:
https://luals.github.io/wiki/annotations/#generic

Solution:
Add support for it in the LuaCATS grammar
2024-05-07 14:33:14 +01:00
dundargoc 01e4a70d66 build: improve git-cliff CHANGELOG output
- Sort sections according to custom preference instead of
  alphabetically. It is ordered according to "most relevant" to "least
  relevant" to users.
- Sort commits alphabetically
- Don't uppercase the first letter of the commit message
2024-05-02 22:57:07 +02:00
Justin M. Keyes cb24a3907c
docs: format vim_diff.txt for "flow" layout #28584 2024-04-30 09:37:45 -07:00
Justin M. Keyes dafa51c16d
docs(api): sort unreleased nvim__ functions last #28580 2024-04-30 06:06:14 -07:00
Justin M. Keyes 71cf75f96a
docs: misc #24163
- Also delete old perl scripts which are not used since 8+ years ago.

fix #23251
fix #27367
ref https://github.com/neovim/neovim/issues/2252#issuecomment-1902662577

Helped-by: Daniel Kongsgaard <dakongsgaard@gmail.com>
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
2024-04-30 04:30:21 -07:00
dundargoc 052498ed42 test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
2024-04-23 18:17:04 +02:00
Justin M. Keyes 9912a4c81b refactor(lua): deprecate tbl_flatten
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:

- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
  - iter.flatten():
    ```
    vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
    ```
  - tbl_flatten:
    ```
    vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
    ```

Solution:
Deprecate tbl_flatten.

Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:

    local anonym = vim.iter({ -- remove nil
      anonymous_num > 1 and '' or nil,
      '---@class ' .. anonymous_classname,
    }):flatten():totable()

Should we enhance :flatten() to work for arrays?
2024-04-22 02:11:23 +02:00
dundargoc 7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
zeertzjq 978962f9a0
build(release.sh): regenerate docs after changing NVIM_API_PRERELEASE (#28229)
After #25574, the value of NVIM_API_PRERELEASE can affect docs, so docs
need to be regenerated after changing NVIM_API_PRERELEASE.
2024-04-08 17:46:41 +08:00
zeertzjq 981301d11f
build(terminfo): include user capabilities in comments (#28066)
Add -x flag to infocmp, so that comments match the content.
2024-03-28 10:23:07 +08:00
Lewis Russell 7d97150084 fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
zeertzjq a142670360
feat(tui): support undercurl in WezTerm (#28037)
Also fix some typos in windows.ti while at it.

Close #21699
2024-03-26 14:25:01 +08:00
Lewis Russell 14e4b6bbd8 refactor(lua): type annotations 2024-03-16 19:26:10 +00:00
Lewis Russell a09ddd7ce5 docs(editorconfig): move to source 2024-03-10 23:20:44 +00:00
Lewis Russell ade1b12f49 docs: support inline markdown
- Tags are now created with `[tag]()`
- References are now created with `[tag]`
- Code spans are no longer wrapped
2024-03-09 11:21:55 +00:00
Lewis Russell a4290f462e docs(lua): improvements for LSP and Diagnostic 2024-03-05 13:36:46 +00:00
Lewis Russell a5fe8f59d9 docs: improve/add documentation of Lua types
- Added `@inlinedoc` so single use Lua types can be inlined into the
  functions docs. E.g.

  ```lua
  --- @class myopts
  --- @inlinedoc
  ---
  --- Documentation for some field
  --- @field somefield integer

  --- @param opts myOpts
  function foo(opts)
  end
  ```

  Will be rendered as

  ```
  foo(opts)

    Parameters:
      - {opts} (table) Object with the fields:
               - somefield (integer) Documentation
                 for some field
  ```

- Marked many classes with with `@nodoc` or `(private)`.
  We can eventually introduce these when we want to.
2024-03-01 23:02:18 +00:00
Will Hopkins 813dd36b72
fix(types): rename win_get_config return type to win_config
Follow-up to #27397
2024-03-02 06:59:32 +08:00
altermo 2f85bbe615 feat!: rewrite TOhtml in lua
Co-authored-by: wookayin <wookayin@gmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-02-28 16:26:00 +00:00
bfredl de5cf09cf9 refactor(metadata): generate all metadata in lua
Then we can just load metadata in C as a single msgpack blob. Which also
can be used directly as binarly data, instead of first unpacking all the
functions and ui_events metadata to immediately pack it again, which was
a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object`
which will get yak shaved in the next PR)
2024-02-28 11:00:38 +01:00
Christian Clason 07b4b7524f vim-patch:e84d2d4432cd
runtime(sh): Update ftplugin, fix vim/vim#14101 (vim/vim#14102)

Add the 'b' flag to 'comments', so that the shebang line is not detected as comment.

Fixes vim/vim#14101.

e84d2d4432

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-28 10:56:58 +01:00
Lewis Russell 9beb40a4db feat(docs): replace lua2dox.lua
Problem:

The documentation flow (`gen_vimdoc.py`) has several issues:
- it's not very versatile
- depends on doxygen
- doesn't work well with Lua code as it requires an awkward filter script to convert it into pseudo-C.
- The intermediate XML files and filters makes it too much like a rube goldberg machine.

Solution:

Re-implement the flow using Lua, LPEG and treesitter.

- `gen_vimdoc.py` is now replaced with `gen_vimdoc.lua` and replicates a portion of the logic.
- `lua2dox.lua` is gone!
- No more XML files.
- Doxygen is now longer used and instead we now use:
  - LPEG for comment parsing (see `scripts/luacats_grammar.lua` and `scripts/cdoc_grammar.lua`).
  - LPEG for C parsing (see `scripts/cdoc_parser.lua`)
  - Lua patterns for Lua parsing (see `scripts/luacats_parser.lua`).
  - Treesitter for Markdown parsing (see `scripts/text_utils.lua`).
- The generated `runtime/doc/*.mpack` files have been removed.
   - `scripts/gen_eval_files.lua` now instead uses `scripts/cdoc_parser.lua` directly.
- Text wrapping is implemented in `scripts/text_utils.lua` and appears to produce more consistent results (the main contributer to the diff of this change).
2024-02-27 14:41:17 +00:00
zeertzjq 741a6684e0
docs(builtin): show tag at first line with multiple signatures (#27577)
Problem:
When a function has multiple signatures, putting its tag at the last one
may make one think that's its only signature.

Solution:
When a function has multiple signatures, put its tag at the first one.
2024-02-22 19:39:58 +08:00
Maria José Solano ac0e8323dc
fix(lsp): add parentheses to generated union array types (#27560) 2024-02-21 12:31:56 +01:00
zeertzjq d040b7341e
build(vim-patch.sh): don't add vim/vim to issue of another repo (#27493) 2024-02-16 20:19:26 +08:00
bfredl f9d81c43d2 refactor(api): use keydict and arena for more api return values
Implement api_keydict_to_dict as the complement to api_dict_to_keydict

Fix a conversion error when nvim_get_win_config gets called from lua,
where Float values "x" and "y" didn't get converted to lua numbers.
2024-02-08 11:14:01 +01:00
Lewis Russell c4417ae70c fix(doc): prevent doxygen confusion 2024-02-06 15:29:01 +00:00
dundargoc 4c91194611 build: various fixes
- Consistently use the variable CMAKE_BUILD_TYPE to select build type.
- Remove broken `doc_html` target.
- Remove swap files created by oldtest when cleaning.
- Only rerun `lintdoc` if any documentation files has changed.
2024-02-01 12:06:55 +01:00
zeertzjq 0a8e66898d
build: update builtin terminfo (#27272)
- Update to ncurses 6.4.20230520
- Disable smglp and smgrp for vtpcon and conemu
- Add xterm+sl to vtpcon, fix #26880
2024-01-31 21:45:30 +08:00
Jongwook Choi be5cf33836
fix(gen_help_html): type warnings, spell_ignore_files #27254
- Add type annotations, fix most of the type warnings.
- Fix a minor bug on `spell_ignore_files`: nil error when an invalid
  spelling is found but the file is not ignored.
2024-01-29 11:02:10 -08:00
Jongwook Choi 5b1b765610
docs: enforce "treesitter" spelling #27110
It's the "tree-sitter" project, but "treesitter" in our code and docs.
2024-01-28 17:53:14 -08:00
Jongwook Choi 01e82eba20
build(docs): separate lint job to validate vimdoc #27227
Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc,
it is no longer as a part of functionaltest (help_spec).

Build (cmake) and CI:

- `make lintdoc`: validate vimdoc files and test-generate HTML docs.
  CI will run this as a part of the "docs" workflow.

- `scripts/lintdoc.lua` is added as an entry point (executable script)
  for validating vimdoc files.

scripts/gen_help_html.lua:

- Move the tests for validating docs and generating HTMLs from
  `help_spec.lua` to `gen_help_html`. Added:
  - `gen_help_html.run_validate()`.
  - `gen_help_html.test_gen()`.

- Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from
  `$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files
  on `./runtime/doc`, not on `./build/runtime/doc`.

- Add type annotations for gen_help_html.
2024-01-28 14:22:39 -08:00
Lewis Russell 28d1640dd6 feat: improve return type annotations for vim.api.* 2024-01-26 15:07:25 +00:00
dundargoc b4da4783f9 build: make genappimage.sh work with existing CMAKE_INSTALL_PREFIX
Using CMAKE_INSTALL_PREFIX is unreliable as it's a cache variable,
meaning the users previous value will be used if not supplied. Instead,
use the `--prefix` flag which is guaranteed to always work.
2024-01-22 12:38:27 +01:00
bfredl 21b36c7d7f
Merge pull request #27076 from glepnir/extmark_hlgroup
refactor(api): use hl id directly in nvim_buf_set_extmark
2024-01-22 09:10:34 +01:00
bfredl d66ed4ea46 refactor(api): give "hl_group" more accurate _meta type
These can either be number or string in lua, so we can specify this
directly as "number|string".
2024-01-22 08:51:54 +01:00
Jongwook Choi fa9a85ae46 fix(lsp): clean up duplicate and unused meta type annotations 2024-01-20 14:02:16 +01:00
altermo 5aa14e1231
fix(lua): return after assert returns assert message (#27064) 2024-01-17 13:34:25 -06:00