aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_vimdoc.py
Commit message (Collapse)AuthorAge
* feat(lua)!: execute Lua with "nvim -l"Justin M. Keyes2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua scripts, especially scripts that take arguments or produce output. Solution: - support "nvim -l [args...]" for running scripts. closes #15749 - exit without +q - remove lua2dox_filter - remove Doxyfile. This wasn't used anyway, because the doxygen config is inlined in gen_vimdoc.py (`Doxyfile` variable). - use "nvim -l" in docs-gen CI job Examples: $ nvim -l scripts/lua2dox.lua --help Lua2DoX (0.2 20130128) ... $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2 $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l - TODO? -e executes Lua code -l loads a module -i enters REPL _after running the other arguments_.
* feat: `vim.inspect_pos`, `vim.show_pos`, `:Inspect`Folke Lemaitre2022-12-17
|
* feat(lsp): initial support for semantic token highlightingJohn Drouhard2022-12-08
| | | | | | * credit to @smolck and @theHamsta for their contributions in laying the groundwork for this feature and for their work on some of the helper utility functions and tests
* docs(treesitter): use full function names in tags (#21321)Gregory Anders2022-12-07
|
* docs(gen): support language annotation in docstringsChristian Clason2022-12-02
|
* feat: add vim.secure.read()Gregory Anders2022-11-17
| | | | | | | | | This function accepts a path to a file and prompts the user if the file is trusted. If the user confirms that the file is trusted, the contents of the file are returned. The user's decision is stored in a trust database at $XDG_STATE_HOME/nvim/trust. When this function is invoked with a path that is already marked as trusted in the trust database, the user is not prompted for a response.
* feat(lua-api): avoid unnecessary allocations (#19877)Lewis Russell2022-11-14
| | | | Lua makes (or reuses) an internal copy of strings, so we can safely push buf pointers onto the stack.
* docs: fix/remove invalid URLs #20647Justin M. Keyes2022-10-14
|
* docs: various #12823Justin M. Keyes2022-10-09
| | | | | | | | | | | | - increase python line-length limit from 88 => 100. - gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains) ref #15632 fix #18215 fix #18479 fix #20527 fix #20532 Co-authored-by: Ben Weedon <ben@weedon.email>
* feat(docs): format parameters as a list #20485Justin M. Keyes2022-10-05
| | | | | | | | | | | Problem: The {foo} parameters listed in `:help api` and similar generated docs, are intended to be a "list" but they aren't prefixed with a list symbol. This prevents parsers from understanding the list, which forces generators like `gen_help_html.lua` to use hard-wrapped/preformatted layout instead of a soft-wrapped "flow" layout. Solution: Modify gen_vimdoc.py to prefix {foo} parameters with a "•" symbol.
* fix(gen_vimdoc.py): handle missing luajitJustin M. Keyes2022-09-25
|
* docs(treesitter): clean up and update treesitter.txt (#20142)Christian Clason2022-09-14
| | | | | * add type annotations to code * clean up and expand static documentation * consistent use of tags for static and generated docs
* perf(api): allow to use an arena for return valuesbfredl2022-08-23
|
* docs: change gen_vimdoc indentation to 4 spacesii142022-08-11
|
* Merge pull request #19409 from bfredl/uiunpackbfredl2022-07-19
|\ | | | | perf(ui): some ui_client fixes/optimizations before externalized TUI
| * fix(rpc): break nvim_error_event feedback loop between two nvim instancesbfredl2022-07-19
| | | | | | | | | | | | In case nvim A sends nvim_error_event to nvim B, it would respond with another nvim_error_event due to unknown request name. Fix this by adding dummy request handler for now.
* | fix(docs): remove internal function from docs (nvim__*)Maverun2022-07-19
|/
* build(gen_vimdoc): remove needless list creation and unused variable (#19079)Axis2022-06-25
| | | build(gen_vimdoc): remove needless list creation
* refactor(api): update vimdocbfredl2022-06-12
|
* feat(fs): add vim.fs.parents()Gregory Anders2022-05-31
| | | | | vim.fs.parents() is a Lua iterator that returns the next parent directory of the given file or directory on each iteration.
* build(gen_vimdoc): eliminate non-constant global variables (#17781)dundargoc2022-05-15
|
* build(gen_vimdoc): print user's doxygen version if it's too oldDundar Goc2022-05-02
| | | | | | @theHamsta suggested in https://github.com/neovim/neovim/pull/18348#discussion_r862594173 to also print the users doxygen version if the version is too old.
* ci(gen_vimdoc): handle edge case when checking doxygen versionDundar Goc2022-05-02
| | | | | | | | | | | When checking the version of the doxygen installed from conda the output has the following format: 1.9.2 (ee54ebd4f0ad83d9c44f19a459146de64d0ffba2*) This would cause an error in the "Missing API docs" CI job. This fix will correctly parse the doxygen version for both stable releases ("1.9.2") as well as the version with the git commit hash attached.
* build(gen_vimdoc): abort if doxygen version is too oldDundar Goc2022-05-01
| | | | | | | | There have been a few instances where developers got confused as to why their generated documentation differs from the one generated by the CI. More often than not, the reason is that their doxygen version is older than 1.9.0, which is the current minimum version. Having a simple version check will help save future developers avoid this problem.
* docs(api): more API attributes #18336ii142022-04-30
|
* docs: remove extra whitespacesDaiki Mizukami2022-03-14
|
* chore(gen_vimdoc): fall back to `brief_desc_node` when `desc_node` is emptyDaiki Mizukami2022-03-14
|
* refactor(gen_vimdoc): simplify `files` in `CONFIG`Daiki Mizukami2022-03-14
|
* chore(gen_vimdoc): call `delete_lines_below` only if the file existsDaiki Mizukami2022-03-14
| | | | | | | Previously, `delete_lines_below` would raise `FileNotFoundError` when adding a new file to `CONFIG` and you had to manually write a file with help tag of the first section as placeholder. This change relieves you of that need.
* refactor(gen_vimdoc): detect `section_start_token` automaticallyDaiki Mizukami2022-03-14
|
* docs(lua): reference runtime/lua/vim/_editor.luazeertzjq2022-03-06
|
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* chore(gen_vimdoc): correct minimum python versionDundar Göc2022-02-05
|
* chore(gen_vimdoc): remove duplicate extmark.c entryDundar Göc2022-02-03
|
* feat(lua): add vim.keymapshadmansaleh2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | This introduces two new functions `vim.keymap.set` & `vim.keymap.del` differences compared to regular set_keymap: - remap is used as opposite of noremap. By default it's true for <Plug> keymaps and false for others. - rhs can be lua function. - mode can be a list of modes. - replace_keycodes option for lua function expr maps. (Default: true) - handles buffer specific keymaps Examples: ```lua vim.keymap.set('n', 'asdf', function() print("real lua function") end) vim.keymap.set({'n', 'v'}, '<leader>lr', vim.lsp.buf.references, {buffer=true}) vim.keymap.set('n', '<leader>w', "<cmd>w<cr>", {silent = true, buffer = 5 }) vim.keymap.set('i', '<Tab>', function() return vim.fn.pumvisible() == 1 and "<C-n>" or "<Tab>" end, {expr = true}) vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)') vim.keymap.del('n', 'asdf') vim.keymap.del({'n', 'i', 'v'}, '<leader>w', {buffer = 5 }) ```
* feat: filetype.lua (#16600)Gregory Anders2022-01-04
| | | | Adds a new vim.filetype module that provides support for filetype detection in Lua.
* fix(docgen): add tagfunc.luaMichael Lingelbach2021-11-18
|
* fix(docs): add sync.lua to gen_vimdoc (#16285)Michael Lingelbach2021-11-11
|
* refactor(api): break out Vim script functions to its own fileBjörn Linse2021-10-29
|
* ci: add newly added api file extmark.c to gen-vimdoc (#16158)dundargoc2021-10-27
|
* fix(gen_vimdoc.py): spacing around inline elements #16092Gregory Anders2021-10-19
| | | | | The spacing fix drew attention to a couple of places that were using incorrect formatting such as the key listing for `nvim_open_win`, so those were fixed too.
* fix(docs): add win_config.cJustin M. Keyes2021-10-05
|
* feat(ui): add vim.ui.select and use in code actions (#15771)Mathias Fußenegger2021-09-27
| | | | | | | | | | | | | Continuation of https://github.com/neovim/neovim/pull/15202 A plugin like telescope could override it with a fancy implementation and then users would get the telescope-ui within each plugin that utilizes the vim.ui.select function. There are some plugins which override the `textDocument/codeAction` handler solely to provide a different UI. With custom client commands and soon codeAction resolve support, it becomes more difficult to implement the handler right - so having a dedicated way to override the picking function will be useful.
* Merge #15585 refactor: move vim.lsp.diagnostic to vim.diagnosticJustin M. Keyes2021-09-16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Overview - Move vim.lsp.diagnostic to vim.diagnostic - Refactor client ids to diagnostic namespaces - Update tests - Write/update documentation and function signatures Currently, non-LSP diagnostics in Neovim must hook into the LSP subsystem. This is what e.g. null-ls and nvim-lint do. This is necessary because none of the diagnostic API is exposed separately from the LSP subsystem. This commit addresses this by generalizing the diagnostic subsystem beyond the scope of LSP. The `vim.lsp.diagnostic` module is now simply a specific diagnostic producer and primarily maintains the interface between LSP clients and the broader diagnostic API. The current diagnostic API uses "client ids" which only makes sense in the context of LSP. We replace "client ids" with standard API namespaces generated from `nvim_create_namespace`. This PR is *mostly* backward compatible (so long as plugins are only using the publicly documented API): LSP diagnostics will continue to work as usual, as will pseudo-LSP clients like null-ls and nvim-lint. However, the latter can now use the new interface, which looks something like this: ```lua -- The namespace *must* be given a name. Anonymous namespaces will not work with diagnostics local ns = vim.api.nvim_create_namespace("foo") -- Generate diagnostics local diagnostics = generate_diagnostics() -- Set diagnostics for the current buffer vim.diagnostic.set(ns, diagnostics, bufnr) ``` Some public facing API utility methods were removed and internalized directly in `vim.diagnostic`: * `vim.lsp.util.diagnostics_to_items` ## API Design `vim.diagnostic` contains most of the same API as `vim.lsp.diagnostic` with `client_id` simply replaced with `namespace`, with some differences: * Generally speaking, functions that modify or add diagnostics require a namespace as their first argument, e.g. ```lua vim.diagnostic.set({namespace}, {bufnr}, {diagnostics}[, {opts}]) ``` while functions that read or query diagnostics do not (although in many cases one may be supplied optionally): ```lua vim.diagnostic.get({bufnr}[, {namespace}]) ``` * We use our own severity levels to decouple `vim.diagnostic` from LSP. These are designed similarly to `vim.log.levels` and currently include: ```lua vim.diagnostic.severity.ERROR vim.diagnostic.severity.WARN vim.diagnostic.severity.INFO vim.diagnostic.severity.HINT ``` In practice, these match the LSP diagnostic severity levels exactly, but we should treat this as an interface and not assume that they are the same. The "translation" between the two severity types is handled transparently in `vim.lsp.diagnostic`. * The actual "diagnostic" data structure is: (**EDIT:** Updated 2021-09-09): ```lua { lnum = <number>, col = <number>, end_lnum = <number>, end_col = <number>, severity = <vim.diagnostic.severity>, message = <string> } ``` This differs from the LSP definition of a diagnostic, so we transform them in the handler functions in vim.lsp.diagnostic. ## Configuration The `vim.lsp.with` paradigm still works for configuring how LSP diagnostics are displayed, but this is a specific use-case for the `publishDiagnostics` handler. Configuration with `vim.diagnostic` is instead done with the `vim.diagnostic.config` function: ```lua vim.diagnostic.config({ virtual_text = true, signs = false, underline = true, update_in_insert = true, severity_sort = false, }[, namespace]) ``` (or alternatively passed directly to `set()` or `show()`.) When the `namespace` argument is `nil`, settings are set globally (i.e. for *all* diagnostic namespaces). This is what user's will typically use for their local configuration. Diagnostic producers can also set configuration options for their specific namespace, although this is generally discouraged in order to respect the user's global settings. All of the values in the table passed to `vim.diagnostic.config()` are resolved in the same way that they are in `on_publish_diagnostics`; that is, the value can be a boolean, a table, or a function: ```lua vim.diagnostic.config({ virtual_text = function(namespace, bufnr) -- Only enable virtual text in buffer 3 return bufnr == 3 end, }) ``` ## Misc Notes * `vim.diagnostic` currently depends on `vim.lsp.util` for floating window previews. I think this is okay for now, although ideally we'd want to decouple these completely.
| * refactor: move vim.lsp.diagnostic to vim.diagnosticGregory Anders2021-09-15
| | | | | | | | | | | | | | | | | | | | | | This generalizes diagnostic handling outside of just the scope of LSP. LSP clients are now a specific case of a diagnostic producer, but the diagnostic subsystem is decoupled from the LSP subsystem (or will be, eventually). More discussion at [1]. [1]: https://github.com/neovim/neovim/pull/15585
* | fix(docs): ignore _*.lua files from auto doc generation #15678Gregory Anders2021-09-16
|/
* docs(gen_vimdoc.py): ignore health.lua files #15614Gregory Anders2021-09-09
|
* chore: add log hander to gen_vimdocMatthieu Coudron2021-07-10
| | | | | so it actually dumps output. Plus a description of what it does in the argparser.
* feat(lsp): Add codelens supportMathias Fussenegger2021-06-14
|
* docs: Treesitter (#13260)TJ DeVries2021-05-01
| | | | | | | | | * doc & fixes: Generate treesitter docs * fixup to treesitter-core * docs(treesitter): fix docs for most functions Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>