Skip to content

Conversation

@uudashr
Copy link
Contributor

@uudashr uudashr commented Dec 12, 2025

When we have prompt to resolve, error is raised.
The command is :Rest curl yank

### Anything
# @prompt lang The accepted language 
GET https://httpbin.io/anything/hello
Accept-Language: {{lang}} 
Error executing Lua callback: ...careem/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:193: Cannot call async function from non-async context
stack traceback:
	[C]: in function 'error'
	...careem/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:193: in function 'input'
	.../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:471: in function 'parse'
	...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:238: in function 'impl'
	...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:309: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:297>

This fix the issue by wrapping it inside nio run function

@uudashr
Copy link
Contributor Author

uudashr commented Dec 16, 2025

@boltlessengineer @NTBBloodbath let me know if you need me to provide with more details

Copy link
Contributor

@boltlessengineer boltlessengineer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! The patch seems good but unfortunately I cannot reproduce the issue on Neovim v0.11.3 (which is quite strange tbh). Can you share the version you are using?

@uudashr
Copy link
Contributor Author

uudashr commented Dec 18, 2025

❯ nvim --version
NVIM v0.11.5
Build type: Release
LuaJIT 2.1.1765228720
Run "nvim -V1 -v" for more info

@boltlessengineer boltlessengineer merged commit 714d551 into rest-nvim:main Dec 18, 2025
2 checks passed
@boltlessengineer
Copy link
Contributor

Merging it. Thank you for your contribution again!

@uudashr
Copy link
Contributor Author

uudashr commented Dec 18, 2025

It might be related to nvim-neotest/nvim-nio@230439d. A Jan 16, 2024 commit

They introduce the opts has strict? field that is defaulted to true.

But I still do not understand how it can happen, like maybe regular updates might causing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants