neovim / node-client

Nvim Node.js client and plugin host
https://neovim.io/node-client/
MIT License
464 stars 49 forks source link

call a function in already started nvim after it has started #361

Closed saidelike closed 1 month ago

saidelike commented 1 month ago

It is kind of related to https://github.com/neovim/node-client/issues/360 but more specific.

At the moment, I start my node plugin test framework from init.lua at nvim startup and it worked fine on Windows/locally but it deadlocks on Linux/CI.

2024-05-18 07:21:15 INF     - recorded/actions/bringVestToCap
2024-05-18 07:21:15 INF     - recorded/actions/callFine
2024-05-18 07:21:15 INF     - recorded/actions/callFineOnBatt
2024-05-18 07:21:15 INF     - recorded/actions/callVest
2024-05-18 07:21:15 INF     - recorded/actions/callVestOnCap
2024-05-18 07:21:15 INF     - recorded/actions/carveVest
2024-05-18 07:21:15 DBG ------------------------------------------------------------------------------
2024-05-18 07:21:15 DBG runTest(/home/runner/work/cursorless/cursorless/data/fixtures/recorded/actions/changeNextInstanceChar.yml)...
2024-05-18 07:21:15 DBG request  -> nvim_command
2024-05-18 07:22:55 DBG ------------------------------------------------------------------------------
2024-05-18 07:22:55 DBG runTest(/home/runner/work/cursorless/cursorless/data/fixtures/recorded/actions/changeNextInstanceChar.yml)...
2024-05-18 07:22:55 DBG request  -> nvim_command
2024-05-18 07:24:35 DBG ------------------------------------------------------------------------------
2024-05-18 07:24:35 DBG runTest(/home/runner/work/cursorless/cursorless/data/fixtures/recorded/actions/changeNextInstanceChar.yml)...
2024-05-18 07:24:35 DBG request  -> nvim_command
2024-05-18 07:26:15 DBG ------------------------------------------------------------------------------
2024-05-18 07:26:15 DBG runTest(/home/runner/work/cursorless/cursorless/data/fixtures/recorded/actions/changeNextInstanceChar.yml)...
2024-05-18 07:26:15 DBG request  -> nvim_command
2024-05-18 07:27:55 DBG ------------------------------------------------------------------------------
2024-05-18 07:27:55 DBG runTest(/home/runner/work/cursorless/cursorless/data/fixtures/recorded/actions/changeNextInstanceChar.yml)...
2024-05-18 07:27:55 DBG request  -> nvim_command
2024-05-18 07:29:35 DBG ------------------------------------------------------------------------------
2024-05-18 07:29:35 DBG runTest(/home/runner/work/cursorless/cursorless/data/fixtures/recorded/actions/changeNextInstanceChar.yml)...
2024-05-18 07:29:35 DBG request  -> nvim_command
2024-05-18 07:31:15 INF     1) recorded/actions/changeNextInstanceChar
2024-05-18 07:31:15 INF     - recorded/actions/chuckArgMadeAndAir

I am not sure if it is a Linux difference or a CI difference but I am investigating if there is any way to kick of the test differently (not from init.lua). For instance, is there a way for me to start nvim, wait a bit that it initialises and then call a function from it, either from node or vim script (since I export the node function into vim script anyway)?

justinmk commented 1 month ago

You issue was resolved here, correct? https://github.com/neovim/neovim/issues/28886

saidelike commented 1 month ago

Correct, it was due to "hit enter to continue" message that was blocking neovim command call from node.