Closed devth closed 4 years ago
@devth Thank you for the reporting!
Does this problem occur in any project? Could you provide the steps to reproduce?
I tried it in my yetibot project. It seems to repro on any file I try requiring after initial :IcedRequire
.
Trying on a fresh project doesn't seem to freeze:
lein new iced-repro
cd iced-repro
iced repl
In neovim:
nvim src/iced_repro/core.clj
:IcedConnect
# nvim freezes for about 1 second
<Leader>eb
# no freeze
So it doesn't appear to happen on a fresh project. I'll keep playing with it. Maybe has to do with how much source code is in the project?
Noticed a large error after connecting and trying to :IcedEval
a simple expression:
|| Connected.
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| Traceback (most recent call last):
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| File "<string>", line 3, in <module>
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| File "/Users/thartman/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 287, in command
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| return self.request('nvim_command', string, **kwargs)
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| File "/Users/thartman/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| res = self._session.request(name, *args, **kwargs)
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| File "/Users/thartman/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| raise self.error_wrapper(err)
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| Error detected while processing function
|| <lambda>7[1]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/nrepl.vim|130| <SNR>197_dispatcher[5]
/Users/thartman/.config/nvim/plugged/vim-iced/autoload/iced/di/bencode/python.vim|13| <SNR>219_decode_via_python[6]
|| provider#python3#Call[18]
|| pynvim.api.nvim.NvimError: b'Keyboard interrupt'
After that when I try to :IcedEval
anything it just says Still reading...
.
@devth I couldn't reproduce the problem with following steps...
:IcedConnect
:IcedRequire
:IcedEval (+ 1 2 3)
I uses nvim 0.3.2. https://github.com/neovim/neovim/releases/tag/v0.3.2
$ nvim --version
NVIM v0.3.2
Build type: RelWithDebInfo
LuaJIT 2.0.5
...
It seems to me you use nvim 0.3.2(nightly), so could you update nvim 0.3.2(released) or later and test again?
Upgraded to NVIM v0.4.0-1183-g8510d5ff8
.
Also upgraded to latest commit on vim-iced
dev branch.
iced repl
in a terminal inside vim:IcedConnect
<Leader>eb
- immediately says Required
in the statusline but then locks up for 10 seconds@devth Thanks! But I cannot reproduce yet.. I'll keep testing with yetibot.core
Strange. I will also keep testing on my side and see if I can narrow down what's going on!
@devth
eb - immediately says Required in the statusline but then locks up for 10 seconds
The fact that "Required" is output means IcedRequire
should have finished.
So something else should be running afterwards. (It may be other configurations or other plugins)
I made a minimal configuration for vim-iced for breaking down this problem.
https://scrapbox.io/vim-iced/Minimal_configuration
Could you launch nvim
with this minimal configuration and test again?
Sorry for the delay. I was able to repro the same issue in the paired down nvim
with minimal config.
@devth
I can reproduce the problem finally!!
Do you have :plugins [[cider/cider-nrepl "..."]]
in your ~/.lein/profiles.clj
?
cider-nrepl plugin injects all cider-nrepl middlewares containing track-state
.
https://github.com/clojure-emacs/cider-nrepl/blob/v0.20.0/src/cider/nrepl.clj#L511
track-state middleware will send a huge data after requiring namespace, and it take times.
iced
command is excluding track-state middleware intentionally.
https://github.com/liquidz/vim-iced/blob/0.9.2/clj/iced_repl.clj#L4-L18
So if you have :plugins [[cider/cider-nrepl "..."]]
in your ~/.lein/profiles.clj
, please delete it.
Amazing! Nice job. I will try this out soon. I always thought cider-nrepl
was required.. at least it is for the other vim clojure plugins I've tried: acid.nvim and vim-fireplace. 🤔
@devth Other plugins may require cider-nrepl
while iced
command injects dependencies automatically.
https://github.com/liquidz/vim-iced/blob/0.9.2/deps.edn#L5
I'll fix to work with track-state
middleware in the future.
I'm having a similar issue with my shadow-cljs project.
It seems that shadow-cljs includes the cider-nrepl
plugin (which includes all the middleware) when cider/cider-nrepl
is detected in your dependencies.
At the moment there's no way to turn this feature off.
@liquidz After speaking to the maintainer of shadow-cljs on slack, you can now disable the automatic inclusion of cider middleware as of 2.8.20!
I just tried it out and the delay is gone now.
@knubie Wow! That's awesome!! Thanks for your reporting!
Closed by branching to #170 Feel free to reopen this issue 😃
After
:IcedConnect
the first:IcedRequire
locks up neovim for about 10 seconds. During this time I can't move the cursor or do anything inside neovim. After that subsequent:IcedRequire
s run nearly instantly.Ref https://github.com/liquidz/vim-iced/issues/77