Skip to content

Commit 0ba1c60

Browse files
chore: fix lint
1 parent 6905b83 commit 0ba1c60

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

lua/rest-nvim/client/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local client = {}
1515
---@return nio.control.Future future Future containing `rest.Response`
1616
function client:request(req)
1717
local future = require("nio").control.future()
18-
vim.print(req)
18+
vim.print(self, req)
1919
return future
2020
end
2121

lua/rest-nvim/parser/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function parser.parse_pre_request_script(node, source, context)
221221
return
222222
end
223223
---@cast script rest.ScriptClient
224-
script:load_pre_req_hook(str, context)()
224+
script.load_pre_req_hook(str, context)()
225225
end
226226

227227
---@param node TSNode
@@ -236,7 +236,7 @@ function parser.parse_request_handler(node, source, context)
236236
return
237237
end
238238
---@cast script rest.ScriptClient
239-
return script:load_post_req_hook(str, context)
239+
return script.load_post_req_hook(str, context)
240240
end
241241

242242
---@param source Source

lua/rest-nvim/script/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ local script = {}
1212

1313
---@param str string
1414
---@param ctx rest.Context
15-
function script:load_pre_req_hook(str, ctx)
15+
function script.load_pre_req_hook(str, ctx)
1616
return function ()
1717
vim.print(str, ctx)
1818
end
1919
end
2020

2121
---@param str string
2222
---@param ctx rest.Context
23-
function script:load_post_req_hook(str, ctx)
23+
function script.load_post_req_hook(str, ctx)
2424
---@param res rest.Response
2525
return function (res)
2626
vim.print(str, ctx, res)

lua/rest-nvim/script/lua.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ end
9696
---@param s string
9797
---@param ctx rest.Context
9898
---@return function
99-
function script:load_pre_req_hook(s, ctx)
99+
function script.load_pre_req_hook(s, ctx)
100100
return script.load(s, script.create_prescript_env(ctx))
101101
end
102102

103103
---@param s string
104104
---@param ctx rest.Context
105105
---@return function
106-
function script:load_post_req_hook(s, ctx)
106+
function script.load_post_req_hook(s, ctx)
107107
return function (res)
108108
script.load(s, script.create_handler_env(ctx, res))()
109109
end

spec/api_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.lua"):load_post_req_hook(script, ctx)
205+
local h = require("rest-nvim.script.lua").load_post_req_hook(script, ctx)
206206
h()
207207
assert.same("new", vim.env["foo"])
208208
assert.same("new", ctx:resolve("bar"))

0 commit comments

Comments
 (0)