@@ -86,11 +86,11 @@ local rest_command_tbl = {
8686 run = {
8787 impl = function (args , _ )
8888 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 " } )
9090 return
9191 end
9292 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 " } )
9494 return
9595 elseif # args == 1 then
9696 request ().run_by_name (args [1 ])
@@ -145,14 +145,14 @@ local rest_command_tbl = {
145145 return
146146 elseif args [1 ] == " set" then
147147 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 " } )
149149 return
150150 end
151151 dotenv ().register_file (args [2 ])
152152 elseif args [1 ] == " select" then
153153 dotenv ().select_file ()
154154 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 " } )
156156 end
157157 end ,
158158 --- @return string[]
@@ -191,47 +191,47 @@ local rest_command_tbl = {
191191 req_node = parser ().get_cursor_request_node ()
192192 if not req_node then
193193 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 " } )
195195 return
196196 end
197197 else
198198 req_node = parser ().get_request_node_by_name (args [2 ])
199199 if not req_node then
200200 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 " } )
202202 return
203203 end
204204 end
205205 local req = parser ().parse (req_node , 0 )
206206 if not req then
207207 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 " } )
209209 return
210210 end
211211 local curl_command = require (" rest-nvim.client.curl.cli" ).builder .build_command (req )
212212 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 " } )
214214 elseif args [1 ] == " comment" then
215215 local req_node
216216 if not args [2 ] then
217217 req_node = parser ().get_cursor_request_node ()
218218 if not req_node then
219219 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 " } )
221221 return
222222 end
223223 else
224224 req_node = parser ().get_request_node_by_name (args [2 ])
225225 if not req_node then
226226 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 " } )
228228 return
229229 end
230230 end
231231 local req = parser ().parse (req_node , 0 )
232232 if not req then
233233 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 " } )
235235 return
236236 end
237237 local curl_command = require (" rest-nvim.client.curl.cli" ).builder .build_command (req )
@@ -241,7 +241,7 @@ local rest_command_tbl = {
241241 -- elseif args[1] == "to-http" then
242242 -- -- TODO: convert comment with curl to http request and insert it below
243243 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 " } )
245245 end
246246 end ,
247247 complete = function (_args )
@@ -262,7 +262,7 @@ local function rest(opts)
262262
263263 if not command then
264264 logger ().error (" Unknown command: " .. cmd )
265- vim .notify (" Unknown command: " .. cmd )
265+ vim .notify (" Unknown command: " .. cmd , vim . log . levels . WARN , { title = " rest.nvim " } )
266266 return
267267 end
268268
0 commit comments