aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
Commit message (Collapse)AuthorAge
...
* feat(docs): replace lua2dox.luaLewis Russell2024-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* refactor(types): fix miscellaneous type warningsMaria José Solano2024-02-25
|
* fix: type warnings in shared.luaLewis Russell2024-02-15
|
* docs: correct on_key docs (#27429)altermo2024-02-12
|
* docs: enforce "treesitter" spelling #27110Jongwook Choi2024-01-28
| | | It's the "tree-sitter" project, but "treesitter" in our code and docs.
* docs(lua): update ":{range}lua" docs + error message #27231Justin M. Keyes2024-01-27
| | | | | - `:lua (no file)` is misleading because `:lua` never takes a file arg, unlike `:source`. - Update various related docs.
* feat(ex_cmds): ranged :lua #27167luukvbaal2024-01-26
| | | | | | :{range}lua executes the specified lines in the current buffer as Lua code, regardless of its extension or 'filetype'. Close #27103
* feat(vim.version): add `vim.version.le` and `vim.version.ge`Jongwook Choi2024-01-21
| | | | | | | | | | | | | - Problem: One cannot easily write something like, for example: `version_current >= {0, 10, 0}`; writing like `not vim.version.lt(version_current, {0, 10, 0})` is verbose. - Solution: add {`le`,`ge`} in addition to {`lt`,`gt`}. - Also improve typing on the operator methods: allow `string` as well. - Update the example in `vim.version.range()` docs: `ge` in place of `gt` better matches the semantics of `range:has`.
* docs(vim.iter): correct `bool` to `boolean` (#27018)notomo2024-01-18
|
* docs: auto-generate docs for `vim.lpeg` and `vim.re`Jongwook Choi2024-01-14
| | | | | | | | | | | | | | | | | - Add section `VIM.LPEG` and `VIM.RE` to docs/lua.txt. - Add `_meta/re.lua` which adds luadoc and type annotations, for the vendored `vim.re` package. - Fix minor style issues on `_meta/lpeg.lua` luadoc for better vimdocs generation. - Fix a bug on `gen_vimdoc` where non-helptags in verbatim code blocks were parsed as helptags, affecting code examples on `vim.lpeg.Cf`, etc. - Also move the `vim.regex` section below so that it can be located closer to `vim.lpeg` and `vim.re`.
* fix(doc): improve doc generation of types using lpegLewis Russell2024-01-11
| | | | Added a lpeg grammar for LuaCATS and use it in lua2dox.lua
* feat(vim.iter): add Iter:flatten (#26786)JD2024-01-10
| | | | | Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jongwook Choi <wookayin@gmail.com>
* fix(docs): make lines not overflow in vim docsJongwook Choi2024-01-09
| | | | | | | | | Problem: Some lines in the generated vim doc are overflowing, not correctly wrapped at 78 characters. This happens when docs body contains several consecutive 'inline' elements generated by doxygen. Solution: Take into account the current column offset of the last line, and prepend some padding before doc_wrap().
* feat(lua): add noref to deepcopyLewis Russell2024-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Currently `deepcopy` hashes every single tables it copies so it can be reused. For tables of mostly unique items that are non recursive, this hashing is unnecessarily expensive Solution: Port the `noref` argument from Vimscripts `deepcopy()`. The below benchmark demonstrates the results for two extreme cases of tables of different sizes. One table that uses the same table lots of times and one with all unique tables. | test | `noref=false` (ms) | `noref=true` (ms) | | -------------------- | ------------------ | ----------------- | | unique tables (50) | 6.59 | 2.62 | | shared tables (50) | 3.24 | 6.40 | | unique tables (2000) | 23381.48 | 2884.53 | | shared tables (2000) | 3505.54 | 14038.80 | The results are basically the inverse of each other where `noref` is much more performance on tables with unique fields, and `not noref` is more performant on tables that reuse fields.
* docs: small fixesdundargoc2024-01-02
| | | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: HiPhish <hiphish@posteo.de> Co-authored-by: JD Rudie <rudiejd@miamioh.edu>
* docs(glob): add glob module (#26853)Mathias Fußenegger2024-01-02
|
* feat(iter): add `Iter.take` (#26525)Will Hopkins2023-12-12
|
* feat(lua): implement Iter:join() (#26416)Gregory Anders2023-12-05
|
* fix(lua): disallow vim.wait() in fast contextsLewis Russell2023-11-27
| | | | | | | `vim.wait()` cannot be called in a fast callback since the main loop cannot be run in that context as it is not reentrant Fixes #26122
* docs: vim.iter #26169Justin M. Keyes2023-11-25
| | | | closes #24141 closes #24746
* fix(vim.region): handle multibyte inclusive selection properly (#26129)zeertzjq2023-11-21
|
* feat: add vim.text module (#26069)Gregory Anders2023-11-16
|
* docs: fix vim.snippet help tags (#26068)Gregory Anders2023-11-16
|
* docs: small fixes (#25831)dundargoc2023-11-03
| | | Co-authored-by: Peter Aronoff <peter@aronoff.org>
* feat(stdlib): add vim.base64 module (#25843)Gregory Anders2023-10-31
| | | Add base64 encode() and decode() functions to a vim.base64 module.
* feat(lsp): add snippet API (#25301)Maria José Solano2023-10-21
|
* docs: do not use deprecated functions #25334Maria José Solano2023-09-24
|
* docs: fix type warningsMaria José Solano2023-09-23
|
* docs: update vim.schedule param name and typeOliver Marriott2023-09-23
| | | | | Per https://github.com/neovim/neovim/pull/25286#discussion_r1332861721 and https://github.com/neovim/neovim/pull/25286#discussion_r1334318352
* docs: clarify vim.schedule_wrap behaviourOliver Marriott2023-09-22
| | | | | | | | | | - Remove the usage of the term "defer" to avoid confusion with `vim.defer_fn`, which also calls `vim.schedule_wrap` internally. - Explicitly state that `vim.schedule_wrap` returns a function in the text. - Mention that arguments are passed along. - Include a usage example. - Rename param to `fn`.
* docs: misc #24561Justin M. Keyes2023-09-20
| | | | fix #24699 fix #25253
* docs: replace <pre> with ``` (#25136)Gregory Anders2023-09-14
|
* docs: fix typos and other small fixes (#25005)dundargoc2023-09-14
| | | | | | | Co-authored-by: nuid64 <lvkuzvesov@proton.me> Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com> Co-authored-by: XTY <xty@xty.io> Co-authored-by: Empa <emanuel@empa.xyz> Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
* feat(vimdoc): support Markdown code blocks (#25127)Gregory Anders2023-09-13
| | | | | | Support Markdown code blocks in addition to <pre> blocks in Doxygen doc comments. Update doc comments in iter.lua as a test.
* refactor(vim.system): factor out on_exit handlingLewis Russell2023-09-05
|
* fix(vim.system): make timeout work properlyLewis Russell2023-09-05
| | | | Mimic the behaviour of timeout(1) from coreutils.
* fix(types): add some return/parameter type annotations (#24867)Maria José Solano2023-08-27
| | | | | * fix(types): add some return/parameter type annotations * fix(types): narrow stdpath parameter further
* docs: various clarifications (#24876)zeertzjq2023-08-26
|
* fix(filetype): call on_detect before setting buffer filetypeGregory Anders2023-08-24
| | | | | | | | | | | | The on_detect functions returned by filetype.lua set buffer local variables which are often used by filetype plugins. For example, the on_detect function for shell buffers sets variables such as b:is_bash or b:is_sh, which are used by the sh ftplugin. When called after setting the buffer's filetype, these variables cannot be used by the ftplugin (because they are not yet defined). Instead, call on_detect before setting the buffer filetype so that any buffer variables set by on_detect can be used in the ftplugin.
* fix(iter): make pipeline termination conditions consistent (#24614)Gregory Anders2023-08-09
| | | | | | | | If an iterator pipeline stage returns nil as its first return value, the other return values are ignored and it is treated as if that stage returned only nil (the semantics of returning nil are different between different stages). This is consistent with how for loops work in Lua more generally, where the for loop breaks when the first return value from the function iterator is nil (see :h for-in for details).
* fix(lua): improve annotations for stricter luals diagnostics (#24609)Christian Clason2023-08-09
| | | | | | | | | | | | | | | Problem: luals returns stricter diagnostics with bundled luarc.json Solution: Improve some function and type annotations: * use recognized uv.* types * disable diagnostic for global `vim` in shared.lua * docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type) * add type alias for lpeg pattern * fix return annotation for `vim.secure.trust` * rename local Range object in vim.version (shadows `Range` in vim.treesitter) * fix some "missing fields" warnings * add missing required fields for test functions in eval.lua * rename lsp meta files for consistency
* fix(filetype): add typing and dry (#24573)Lewis Russell2023-08-08
|
* fix(lua): vim.fs typing (#24608)Lewis Russell2023-08-08
|
* docs: luaref cleanup #24541Justin M. Keyes2023-08-03
| | | | - drop "luaref-" prefix in favor of "lua-" or nothing, where possible. - remove redundant "luaref--lang…" and "luaref-api…" tags.
* docs: remove "#" comment char in @returnJustin M. Keyes2023-08-03
| | | | | | | Everything after a "#" char is a "description" comment, i.e. luals won't treat it as a type, name, etc. But "#" should not be present in the generated docs (such as :help docs). https://github.com/LuaLS/lua-language-server/wiki/Annotations#return
* docs: miscJustin M. Keyes2023-08-03
| | | | Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
* fix(loader): cache path ambiguity #24491Tyler Miller2023-08-01
| | | | | | | | | | | Problem: cache paths are derived by replacing each reserved/filesystem- path-sensitive char with a `%` char in the original path. With this method, two different files at two different paths (each containing `%` chars) can erroneously resolve to the very same cache path in certain edge-cases. Solution: derive cache paths by url-encoding the original (path) instead using `vim.uri_encode()` with `"rfc2396"`. Increment `Loader.VERSION` to denote this change.
* docs(lua): vim.str_utf_{start,end,pos} #24424altermo2023-07-29
| | | Closes #24422
* feat(docs): generate builtin.txt (#24493)Lewis Russell2023-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - eval.lua is now the source of truth. - Formatting is much more consistent. - Fixed Lua type generation for polymorphic functions (get(), etc). - Removed "Overview" section from builtin.txt - Can generate this if we really want it. - Moved functions from sign.txt and testing.txt into builtin.txt. - Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred. - Removed the temp-file-name tag from tempname() - Moved lueval() from lua.txt to builtin.txt. * Fix indent * fixup! * fixup! fixup! * fixup! better tag formatting * fixup: revert changes no longer needed * fixup! CI --------- Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* docs(lua): add missing word in docs for vim.empty_dict (#24401)Gnik2023-07-22
|