Commit Graph

885 Commits

Author SHA1 Message Date
Justin M. Keyes
214ce8d33c
fix(gen_help_html): first tag in h2 is broken #30720
Problem:
In h2 headings, the first tag points to an invalid anchor. This used to
work but regressed a few months ago, possibly related to
ceea6898a8.

Solution:
- Simplify the logic, don't try to be clever:
  - Always use to_heading_tag() for the h2 `id`.
- Also:
  - Render tags as `<span>`, because `<code>` is unnecessary and doesn't
    look great in headings.
  - In the main h1, use "foo.txt" as the anchor `name` (rarely used),
    prefer the next found tag for the `href`.
2024-10-08 07:42:20 -07:00
Justin M. Keyes
7335988ce6
docs: generate params/returns in builtin.txt #30654 2024-10-07 05:32:49 -07:00
Justin M. Keyes
6628741ada
feat(docs): improve @see meta docstrings #30693 2024-10-06 09:12:35 -07:00
Justin M. Keyes
056009f741
fix(docs): markdown instead of vimdoc in meta docstrings #30680
LuaLS/meta docstrings expect markdown, not vimdoc. This matters for lists, codeblocks, etc.

Also, line length doesn't matter for docstrings.
2024-10-06 03:24:21 -07:00
Justin M. Keyes
8801b77ed0
fix(docs): missing @returns desc in _meta/api.lua #30673 2024-10-05 08:52:57 -07:00
Justin M. Keyes
9a5bbaf813
docs: more @since annotations #30660 2024-10-04 08:12:17 -07:00
Justin M. Keyes
b45c50f314
docs: render @since versions, 0 means experimental #30649
An implication of this current approach is that `NVIM_API_LEVEL` should be
bumped when a new Lua function is added.

TODO(future): add a lint check which requires `@since` on all new functions.

ref #25416
2024-10-04 02:13:31 -07:00
Riley Bruins
f62728cd80
docs(treesitter): generate TSNode, TSTree docs #30643
**Problem:** The documentation for `TSNode` and `TSTree` methods is
incomplete from the LSP perspective. This is because they are written
directly to the vimdoc, rather than in Lua and generated to vimdoc.

**Solution:** Migrate the docs to Lua and generate them into the vimdoc.
This requires breaking up the `treesitter/_meta.lua` file into a
directory with a few different modules.

This commit also makes the vimdoc generator slightly more robust with
regard to sections that have multiple help tags (e.g. `*one* *two*`)
2024-10-03 16:57:19 -07:00
James Trew
385fbfb3e7
docs: improve luacats support #30580
Some composite/compound types even as basic as `(string|number)[]` are
not currently supported by the luacats LPEG grammar used by gen_vimdoc.
It would be parsed & rendered as just `string|number`.

Changeset adds better support for these types.
2024-10-03 03:45:51 -07:00
Justin M. Keyes
72892aab06 docs(gen_help_html.lua): h4 pseudo-heading layout
Problem:
The <br> hack in a0c64fe816 causes weird layout if a "h4 pseudo-heading"
is not the only tag on the line. For example in the help text below, the
"*'buflisted'*" tag was treated as h4 and followed by <br>, which is
obviously wrong:

                            *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85*
    'buflisted' 'bl'    boolean (default on)

Solution:
Only treat a tag as "h4 pseudo-heading" if it is the only tag in the
line. This is fragile, but in practice seems to get the right balance.
2024-10-01 12:51:16 +02:00
Justin M. Keyes
a0c64fe816
docs(gen_help_html.lua): h4 pseudo-heading layout #30609
Problem:
The right-aligned tag "pseudo-heading" layout mushes together with the
left-aligned text. This is especially messy in a narrow viewport.

Solution:
Put a `<br>` on it. This is a hack until tree-sitter-vimdoc recognizes
these pseudo-headings.
2024-10-01 02:52:07 -07:00
Justin M. Keyes
20251be15a docs: graduate editorconfig.txt to "flow layout"
fix #25401
2024-09-30 00:43:44 +02:00
Riley Bruins
0f067cd34d fix(treesitter): suppress get_parser warnings via opts.error 2024-09-28 00:31:45 +02:00
Justin M. Keyes
ce7017b850
docs: render @see, @note items in _meta/api.lua #30494 2024-09-25 02:34:13 -07:00
Justin M. Keyes
737f58e232 refactor(api)!: rename Dictionary => Dict
In the api_info() output:

    :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
    ...

    {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}

The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
2024-09-23 14:42:57 +02:00
Justin M. Keyes
22553e1f38
docs: graduate tui.txt to "flow layout" #30413 2024-09-18 01:28:00 -07:00
Justin M. Keyes
44afd07443
docs(tui): rename term.txt, nvim_terminal_emulator.txt #30398
Problem:
It has long been a convention that references to the builtin terminal UI
should mention "tui", not "term", in order to avoid ambiguity vs the
builtin `:terminal` feature. The final step was to rename term.txt;
let's that step.

Solution:
- rename term.txt => tui.txt
- rename nvim_terminal_emulator.txt => terminal.txt
- `gen_help_html.lua`: generate redirects for renamed pages.
2024-09-18 00:26:01 -07:00
Riley Bruins
b9b408a56c
feat(treesitter): start moving get_parser to return nil #30313
**Problem:** `vim.treesitter.get_parser` will throw an error if no parser
can be found.

- This means the caller is responsible for wrapping it in a `pcall`,
  which is easy to forget
- It also makes it slightly harder to potentially memoize `get_parser`
  in the future
- It's a bit unintuitive since many other `get_*` style functions
  conventionally return `nil` if no object is found (e.g. `get_node`,
  `get_lang`, `query.get`, etc.)

**Solution:** Return `nil` if no parser can be found or created

- This requires a function signature change, and some new assertions in
  places where the parser will always (or should always) be found.
- This commit starts by making this change internally, since it is
  breaking. Eventually it will be rolled out to the public API.
2024-09-13 05:09:11 -07:00
Christian Clason
a5bd6665b0 fix(scripts): update bundled dependencies in bump_deps 2024-09-11 11:10:40 +02:00
Justin M. Keyes
61e9137394
docs: misc #28970 2024-09-01 13:01:24 -07:00
JonnyKong
b8135a76b7 fix(docs): wrong return value annotation for nvim_buf_get_extmarks 2024-08-25 08:36:00 +01:00
Rosen Stoyanov
8faa369791
docs(gen_help_html): wrap headings for narrow viewport #29903
Problem:
The headings and help tags overlap when browsing the docs in neovim.io/doc/user/ from a mobile phone.

Solution:
Apply the correct CSS rules so that the headings and help tags wrap
nicely below one another.
2024-08-20 05:56:37 -07:00
Ricardo Casía
766d503627
docs(lsp): annotate with vim.lsp.protocol.Methods enum #29521
Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
2024-08-20 05:52:14 -07:00
Maria José Solano
a901fb875f
fix(docs): add missing properties to hl_info #30032 2024-08-16 08:36:23 -07:00
Yi Ming
cc26cf0400 fix(docs): do not treat indexes as short_link 2024-08-06 18:18:34 +02:00
bfredl
f926cc32c9 refactor(shada): rework msgpack decoding without msgpack-c
This also makes shada reading slightly faster due to avoiding
some copying and allocation.

Use keysets to drive decoding of msgpack maps for shada entries.
2024-08-05 11:12:44 +02:00
Mathias Fußenegger
0a0962a2e8
refactor(lsp): remove freeze() from gen_lsp (#29955)
To match the change in https://github.com/neovim/neovim/pull/29283
2024-08-02 13:00:11 +02:00
zeertzjq
3146433190
build(vim-patch.sh): use 7 hex digits for runtime patch file name (#29940)
7 digits are used in commit message, so also using this in patch file
name allows its proper deletion on PR creation.
2024-08-01 20:37:43 +08:00
zeertzjq
545aafbeb8
vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)
Problem:  No way to get the arity of a Vim function
          (Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
          argument info using get(func, "arity") (LemonBoy)

fixes: vim/vim#15097
closes: vim/vim#15109

48b7d05a4f

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 08:07:16 +08:00
zeertzjq
487f44a6c1
fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583)
Unlike vim.fn.expand(), vim.fs.normalize() doesn't expand wildcards.
2024-07-09 19:17:50 +08:00
zeertzjq
9dc09a4cdd
ci(lintcommit): allow capitalized letter after colon in description (#29480) 2024-06-26 05:08:15 +08:00
TheLeoP
6c3f7e7e27 fix(gen_vimdoc): correctly generate function fields 2024-06-22 20:00:13 +01:00
zeertzjq
b923fcbaf0
build(vim-patch.sh): don't ignore changes to version*.txt (#29425)
Suggest adding them to news.txt instead.

Also don't ignore changes to intro.txt and sponsor.txt, as they don't
change much these days, and it's necessary to consider whether to
include their changes in Nvim's intro.txt.
2024-06-20 20:16:53 +08:00
Justin M. Keyes
ceea6898a8
fix(gen_help_html): handle delimiter, heading #29415
Problem:
vimdoc grammar added new forms that are not handled in our HTML
generator. https://github.com/neovim/tree-sitter-vimdoc/pull/134

Solution:
Update `gen_help_html.lua`.

Fixes #29277
2024-06-19 09:45:40 -07:00
Will Hopkins
e947f226be fix(types): use vararg return type annotation
build(types): allow vararg returns in function types
2024-06-11 16:36:29 +01:00
Lewis Russell
5e49ef0af3 refactor(lua): improve type annotations 2024-06-11 12:45:43 +01:00
dundargoc
6c7677e5d2
revert(commitlint): stop ignoring "fixup" commits (#29184)
This reverts 2875d45e79.

Allowing lintcommit to ignore "fixup" makes it too easy to fixup commits
to be merged on master as the CI won't give any indications that
something is wrong. Contributors can always squash their pull requests
if it annoys them too much.
2024-06-07 11:36:14 +08:00
Ilia Choly
8cbb1f20e5
refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
Ilia Choly
9eb0426002 fix(luacats): allow all types inside tuples 2024-06-01 12:56:43 +01:00
Ilia Choly
d62d181ce0
refactor(lsp): use tuple syntax in generated protocol types (#29110) 2024-05-31 16:48:05 +02:00
Ilia Choly
217828b20c fixup! docs(luacats): add tuple support 2024-05-31 15:00:17 +01:00
Ilia Choly
d87ecfc8bc docs(luacats): add tuple support 2024-05-31 15:00:17 +01:00
Gregory Anders
0bdd602bf9
Merge pull request #27339 from MariaSolOs/completion
feat(lsp): completion side effects
2024-05-28 12:39:30 -05:00
Maria José Solano
ff097f2091 feat(lsp): completion side effects 2024-05-27 14:53:28 -07:00
dundargoc
6e8a728e3d refactor: fix luals type warnings 2024-05-27 20:48:46 +02:00
dundargoc
93c55c238f
test(lintdoc): check that input list is same length as output list (#28976) 2024-05-25 07:39:06 +08:00
dundargoc
6dc62c2e2b docs: extract health to its own file 2024-05-24 11:07:30 +02:00
Saien Govender
c614969570
build(docs): update CSS #28896
Problem:
Not using minified version of bootstrap.
Don't need to load normalize with new version of bootstrap.
See https://github.com/neovim/neovim.github.io/pull/350

Solution:
Update link to bootstrap file.
Remove link to normalize.
2024-05-23 06:20:29 -07:00
dundargoc
e8f7025de1 docs: move vim.health documentation to lua.txt
`vim.health` is not a "plugin" but part of our Lua API and the
documentation should reflect that. This also helps make the
documentation maintenance easier as it is now generated.
2024-05-22 20:15:17 +02:00
Jongwook Choi
7aaa4a51b7
build(vim-patch.sh): include commit subject #28767
Problem: vim-patch commits lack an informative title and summary in the
very first line of the commit message when the vim-revision is a Git SHA
hash, unlike when is a Vim version. This makes it difficult to discern
at a glance what changes are introduced by such vim-patch commits (in
git log, PR title, changelog generated by git-cliff, etc.).

BEFORE:

    vim-patch:abcdef123456

    runtime(vim): improve performance

    <some details>
    ...

Solution: Repeat the title of the upstream commit message, to improve
the clarity and visibility of the commit message.

AFTER:

    vim-patch:abcdef123456: runtime(vim): improve performance

    <some details>
    ...

Note: the `vim-patch:<hash>` token is still needed by `vim-patch.sh`
(but not necessarily in the very first line of the commit message) to
determine which vim patches have been applied. `<hash>` is internally
normalized to 7 hex digits.
2024-05-21 09:10:39 -07:00