aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/net.lua
Commit message (Collapse)AuthorAge
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(lua): enable assignment type checking in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | Enable EmmyLua's assign-type-mismatch diagnostic after correcting the runtime annotations and assignments it flags. Correct option, tuple, and return types, and use separate locals when a value changes representation. Add guards and narrow casts where needed so the runtime passes the stricter check. Regenerate the affected docs. AI-assisted
* build: enable more EmmyLua checksLewis Russell2026-09-08
| | | | | | | | | | | | | | | | - call-non-callable - missing-fields - redefined-label - redefined-local - undefined-field - unreachable-code Promote redefined-local and unreachable-code to warnings. Fix DOS line-ending handling for multiline semantic tokens, and support intersection types in the help parser. AI-assisted
* fix(vim.net): unreliable integration tests #39594Ellison2026-05-05
|
* feat(vim.net): request() accepts more http methods #39406Ellison2026-05-01
|
* docs: miscJustin M. Keyes2026-04-12
| | | | | | | | Close #38748 Close #38866 Co-authored-by: Mario Loriedo <mario.loriedo@gmail.com> Co-authored-by: Anakin Childerhose <anakin@childerhose.ca>
* feat(vim.net): custom request() headers #38837Ellison2026-04-10
| | | | | | | Problem Cannot specify headers in vim.net.request() call. Solution Support opts.headers in vim.net.request opts.
* fix(vim.net): check if vim.system's stdout is nil #38713Yochem van Rosmalen2026-04-05
| | | | | | | | | Problem: Apparently vim.SystemCompleted.stdout can also be nil, even without a custom stdout handler. (Although the docs can be interpreted otherwise). Solution: Explicitly check for nil and set the result body to an empty string if stdout was nil.
* fix(vim.net): always pass response body to on_response #38460Yochem van Rosmalen2026-03-24
| | | | | | | | | | Problem: on_response(err, response) handler doesn't receive a response when an output buffer or path is supplied to vim.net.request. User might want to both output output to a file/buffer and also do something with it on response. Solution: If an on_response handler was given, then pass the response to it.
* docs: api, plugins, ui2Justin M. Keyes2026-03-24
|
* feat(net): vim.net.request(outbuf) writes response to buffer #36164Yochem van Rosmalen2026-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Non-trivial to write output of vim.net.request to buffer. Requires extra code in plugin/net.lua which can't be reused by other plugin authors. ``` vim.net.request('https://neovim.io', {}, function(err, res) if not err then local buf = vim.api.nvim_create_buf(true, false) if res then local lines = vim.split(res.body, '\n', { plain = true }) vim.api.nvim_buf_set_lines(buf, 0, -1, true, lines) end end end) ``` Solution: Accept an optional `outbuf` argument to indicate the buffer to write output to, similar to `outpath`. vim.net.request('https://neovim.io', { outbuf = buf }) Other fixes / followups: - Make plugin/net.lua smaller - Return objection with close() method - vim.net.request.Opts class - vim.validate single calls - Use (''):format(...) instead of `..`
* fix: misc typos #37471phanium2026-01-27
|
* docs: small fixes (#35791)zeertzjq2025-09-16
| | | | | | | | | | | | | | | | | | | | | Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
* docs: lsp, ui events, dev guidance, osc7Justin M. Keyes2025-07-28
| | | | fix #34981
* feat(net): vim.net.request(), :edit [url] #34140Tom Ampuero2025-07-13
Problem: Nvim depends on netrw to download/request URL contents. Solution: - Add `vim.net.request()` as a thin curl wrapper: - Basic GET with --silent, --show-error, --fail, --location, --retry - Optional `opts.outpath` to save to a file - Operates asynchronously. Pass an `on_response` handler to get the result. - Add integ tests (requires NVIM_TEST_INTEG to be set) to test success and 404 failure. - Health check for missing `curl`. - Handle `:edit https://…` using `vim.net.request()`. API Usage: 1. Asynchronous request: vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response) if err then print('Fetch failed:', err) else print('Got body of length:', #response.body) end end) 2. Download to file: vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err) if err then print('Error:', err) end end) 3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer: :edit https://httpbingo.org/get