@@ -86,11 +86,11 @@ local rest_command_tbl = {
86
86
run = {
87
87
impl = function (args , _ )
88
88
if vim .bo .filetype ~= " http" or vim .b .__rest_no_http_file then
89
- vim .notify (" `:Rest run` can be only called from http file" , vim .log .levels .ERROR )
89
+ vim .notify (" `:Rest run` can be only called from http file" , vim .log .levels .ERROR , { title = " rest.nvim " } )
90
90
return
91
91
end
92
92
if # args > 1 then
93
- vim .notify (" Running multiple request isn't supported yet" , vim .log .levels .WARN )
93
+ vim .notify (" Running multiple request isn't supported yet" , vim .log .levels .WARN , { title = " rest.nvim " } )
94
94
return
95
95
elseif # args == 1 then
96
96
request ().run_by_name (args [1 ])
@@ -145,14 +145,14 @@ local rest_command_tbl = {
145
145
return
146
146
elseif args [1 ] == " set" then
147
147
if # args < 2 then
148
- vim .notify (" Not enough arguments were passed to the 'env' command: 2 argument were expected, 1 was passed" , vim .log .levels .ERROR )
148
+ vim .notify (" Not enough arguments were passed to the 'env' command: 2 argument were expected, 1 was passed" , vim .log .levels .ERROR , { title = " rest.nvim " } )
149
149
return
150
150
end
151
151
dotenv ().register_file (args [2 ])
152
152
elseif args [1 ] == " select" then
153
153
dotenv ().select_file ()
154
154
else
155
- vim .notify (" Invalid action '" .. args [1 ] .. " ' provided to 'env' command" , vim .log .levels .ERROR )
155
+ vim .notify (" Invalid action '" .. args [1 ] .. " ' provided to 'env' command" , vim .log .levels .ERROR , { title = " rest.nvim " } )
156
156
end
157
157
end ,
158
158
--- @return string[]
@@ -191,47 +191,47 @@ local rest_command_tbl = {
191
191
req_node = parser ().get_cursor_request_node ()
192
192
if not req_node then
193
193
logger ().error (" failed to find request at cursor position" )
194
- vim .notify (" [rest.nvim] failed to find request at cursor position" , vim .log .levels .ERROR )
194
+ vim .notify (" failed to find request at cursor position" , vim .log .levels .ERROR , { title = " rest.nvim " } )
195
195
return
196
196
end
197
197
else
198
198
req_node = parser ().get_request_node_by_name (args [2 ])
199
199
if not req_node then
200
200
logger ().error (" failed to find request with name:" .. args [2 ])
201
- vim .notify (" [rest.nvim] failed to find request with name:" .. args [2 ], vim .log .levels .ERROR )
201
+ vim .notify (" failed to find request with name:" .. args [2 ], vim .log .levels .ERROR , { title = " rest.nvim " } )
202
202
return
203
203
end
204
204
end
205
205
local req = parser ().parse (req_node , 0 )
206
206
if not req then
207
207
logger ().error (" failed to parse request" )
208
- vim .notify (" [rest.nvim] failed to parse request. See `:Rest logs` for more info" , vim .log .levels .ERROR )
208
+ vim .notify (" failed to parse request. See `:Rest logs` for more info" , vim .log .levels .ERROR , { title = " rest.nvim " } )
209
209
return
210
210
end
211
211
local curl_command = require (" rest-nvim.client.curl.cli" ).builder .build_command (req )
212
212
vim .fn .setreg (" +" , curl_command )
213
- vim .notify (" [rest.nvim] Copied curl command to clipboard" , vim .log .levels .INFO )
213
+ vim .notify (" Copied curl command to clipboard" , vim .log .levels .INFO , { title = " rest.nvim " } )
214
214
elseif args [1 ] == " comment" then
215
215
local req_node
216
216
if not args [2 ] then
217
217
req_node = parser ().get_cursor_request_node ()
218
218
if not req_node then
219
219
logger ().error (" failed to find request at cursor position" )
220
- vim .notify (" [rest.nvim] failed to find request at cursor position" , vim .log .levels .ERROR )
220
+ vim .notify (" failed to find request at cursor position" , vim .log .levels .ERROR , { title = " rest.nvim " } )
221
221
return
222
222
end
223
223
else
224
224
req_node = parser ().get_request_node_by_name (args [2 ])
225
225
if not req_node then
226
226
logger ().error (" failed to find request with name:" .. args [2 ])
227
- vim .notify (" [rest.nvim] failed to find request with name:" .. args [2 ], vim .log .levels .ERROR )
227
+ vim .notify (" failed to find request with name:" .. args [2 ], vim .log .levels .ERROR , { title = " rest.nvim " } )
228
228
return
229
229
end
230
230
end
231
231
local req = parser ().parse (req_node , 0 )
232
232
if not req then
233
233
logger ().error (" failed to parse request" )
234
- vim .notify (" [rest.nvim] failed to parse request. See `:Rest logs` for more info" , vim .log .levels .ERROR )
234
+ vim .notify (" failed to parse request. See `:Rest logs` for more info" , vim .log .levels .ERROR , { title = " rest.nvim " } )
235
235
return
236
236
end
237
237
local curl_command = require (" rest-nvim.client.curl.cli" ).builder .build_command (req )
@@ -241,7 +241,7 @@ local rest_command_tbl = {
241
241
-- elseif args[1] == "to-http" then
242
242
-- -- TODO: convert comment with curl to http request and insert it below
243
243
else
244
- vim .notify (" Invalid action '" .. args [1 ] .. " ' provided to 'curl' command" , vim .log .levels .ERROR )
244
+ vim .notify (" Invalid action '" .. args [1 ] .. " ' provided to 'curl' command" , vim .log .levels .ERROR , { title = " rest.nvim " } )
245
245
end
246
246
end ,
247
247
complete = function (_args )
@@ -262,7 +262,7 @@ local function rest(opts)
262
262
263
263
if not command then
264
264
logger ().error (" Unknown command: " .. cmd )
265
- vim .notify (" Unknown command: " .. cmd )
265
+ vim .notify (" Unknown command: " .. cmd , vim . log . levels . WARN , { title = " rest.nvim " } )
266
266
return
267
267
end
268
268
0 commit comments