Closed TimPelgrim closed 6 months ago
a1a2415165
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
Here are the GitHub Actions logs prior to making any changes:
e3c0fb4
Checking lua/hurl/main.lua for syntax errors... ✅ lua/hurl/main.lua has no syntax errors!
1/1 ✓Checking lua/hurl/main.lua for syntax errors... ✅ lua/hurl/main.lua has no syntax errors!
Sandbox passed on the latest main
, so sandbox checks will be enabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
lua/hurl/main.lua
✓ https://github.com/jellydn/hurl.nvim/commit/fed85aa9c948dbff083e30212f8b568f03daa58f Edit
Modify lua/hurl/main.lua with contents:
• To prevent the attempt to concatenate a nil value and to handle the error more gracefully, change the log and notification lines to check if `result.start_line` is nil before using it. If `result.start_line` is nil, provide a generic message that does not attempt to use it.
• Replace the existing lines 419 and 420 with the following code snippet: ```lua if result.start_line then utils.log_info('hurl: not HTTP method found in the current line ' .. result.start_line) else utils.log_info('hurl: no HTTP method found in the current line') end utils.notify('hurl: no HTTP method found in the current line', vim.log.levels.INFO) ```
• This change ensures that if `result.start_line` is nil, the code does not attempt to concatenate it, thus avoiding the error. It also provides a clear notification to the user that no HTTP method was found in the current line, regardless of whether `result.start_line` is nil.
--- +++ @@ -353,7 +353,11 @@ ) run_at_lines(result.start_line, result.end_line, opts.fargs) else - utils.log_info('hurl: not HTTP method found in the current line' .. result.start_line) + if result.start_line then + utils.log_info('hurl: not HTTP method found in the current line ' .. result.start_line) + else + utils.log_info('hurl: no HTTP method found in the current line') + end utils.notify('hurl: no HTTP method found in the current line', vim.log.levels.INFO) end end, { nargs = '*', range = true }) @@ -416,7 +420,11 @@ vim.cmd('copen') end) else - utils.log_info('hurl: not HTTP method found in the current line' .. result.start_line) + if result.start_line then + utils.log_info('hurl: not HTTP method found in the current line ' .. result.start_line) + else + utils.log_info('hurl: no HTTP method found in the current line') + end utils.notify('hurl: no HTTP method found in the current line', vim.log.levels.INFO) end end, { nargs = '*', range = true })
lua/hurl/main.lua
⋯ Edit
Check lua/hurl/main.lua with contents:
Ran GitHub Actions for fed85aa9c948dbff083e30212f8b568f03daa58f:
• pandoc to vimdoc: ⋯
I have finished reviewing the code for completeness. I did not find errors for sweep/getting_errors_while_running_in_simple_h
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.Something wrong? Let us know.
This is an automated message generated by Sweep AI.
Hi @TimPelgrim Thank you for your report. Could you check again with latest version? It should work now.
Details
Have tried with multiple files, each resulting in the following error:
I installed with the basic config using LazyVim, specificly this lua file: