Skip to content

Commit 0f9b600

Browse files
chore: type issues
1 parent 4751980 commit 0f9b600

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

lua/rest-nvim/api.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ api.namespace = vim.api.nvim_create_namespace("rest-nvim")
3030
---@param cb string|fun(args: table) Autocommand lua callback, runs a Vimscript command instead if it is a `string`
3131
---@param description string Autocommand description
3232
function api.register_rest_autocmd(events, cb, description)
33+
---@diagnostic disable-next-line: invisible
3334
autocmds.register_autocmd(events, cb, description)
3435
end
3536

3637
---Register a new `:Rest` subcommand
3738
---@param name string The name of the subcommand to register
3839
---@param cmd RestCmd
3940
function api.register_rest_subcommand(name, cmd)
41+
---@diagnostic disable-next-line: invisible
4042
commands.register_subcommand(name, cmd)
4143
end
4244

lua/rest-nvim/client/curl/libcurl.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
---
77
---@brief ]]
88

9+
---@diagnostic disable: undefined-field
10+
911
local client = {}
1012

1113
local found_curl, curl = pcall(require, "cURL.safe")
@@ -58,7 +60,7 @@ end
5860
function client.request_(request)
5961
logger.info("sending request to: " .. request.url)
6062
-- write to `Context.response` without altering the reference
61-
local info = request.context.response
63+
local info = request.context.aesponse
6264
if not found_curl then
6365
---@diagnostic disable-next-line need-check-nil
6466
logger.error("lua-curl could not be found, therefore the cURL client will not work.")

spec/api_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ local context = require("rest-nvim.context").Context
88
local logger = require("rest-nvim.logger")
99

1010
local spy = require("luassert.spy")
11-
---@diagnostic disable-next-line: inject-field
12-
assert.spy = assert.spy
1311

1412
local function open(path)
1513
vim.cmd.edit(path)
@@ -73,6 +71,7 @@ describe("parser", function()
7371
local req_node = assert(tree:root():child(0))
7472
local spy_log_warn = spy.on(logger, "warn")
7573
parser.parse(req_node, source)
74+
---@diagnostic disable-next-line: undefined-field
7675
assert.spy(spy_log_warn).called_with("invalid json: '{\n\t\"blah\": 1'")
7776
end)
7877
it("parse xml", function ()
@@ -110,6 +109,7 @@ describe("parser", function()
110109
local req_node = assert(tree:root():child(0))
111110
local spy_log_warn = spy.on(logger, "warn")
112111
parser.parse(req_node, source)
112+
---@diagnostic disable-next-line: undefined-field
113113
assert.spy(spy_log_warn).called_with("invalid xml: '<?xml'")
114114
end)
115115
it("parse with variables in header", function ()
@@ -202,7 +202,7 @@ X-DATE: {{$date}}
202202
request.variables.set("bar", "new")
203203
request.variables.set("baz", "new")
204204
]]
205-
local h = require("rest-nvim.script").load_handler(script, ctx)
205+
local h = require("rest-nvim.script.lua").load_handler(script, ctx)
206206
h()
207207
assert.same("new", vim.env["foo"])
208208
assert.same("new", ctx:resolve("bar"))

spec/dotenv_spec.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
require("spec.minimum_init")
44

5-
local dotenv = require("rest-nvim.dotenv")
6-
75
local function open(path)
86
vim.cmd.edit(path)
97
vim.cmd.source("ftplugin/http.lua")

0 commit comments

Comments
 (0)