dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

Emacs freezes when robe is called while byebug is active on console #130

Open otavioschwanck opened 3 years ago

otavioschwanck commented 3 years ago

when byebug is active on the console and i try to call some robe action (like company or go to definition), the emacs freezes.

dgutov commented 3 years ago

How/when does this happen?

Doesn't one usually use byebyg from binding.pry somewhere inside test code, rather than inside the main project IRB console?

Even so, I tried the latter, and robe didn't freeze.

Need step-by-step scenario.

otavioschwanck commented 3 years ago

@dgutov

How/when does this happen?

Doesn't one usually use byebyg from binding.pry somewhere inside test code, rather than inside the main project IRB console?

Even so, I tried the latter, and robe didn't freeze.

Need step-by-step scenario.

occurs when byebug is called on console (using inf-ruby).

1 - add byebug to your project: gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]

2 - place byebug on some class (lib/foo.rb on initialize)

3 - Open rails console in emacs and start robe (robe-start)

4 - on rails console, call Foo.new

5 - A byebug will open on console

6 - in any file of your project, call robe-jump or company-robe.

7 - The freeze will happen.

Happens on macos and linux. Emacs 26, 27 and 28.

Video: https://user-images.githubusercontent.com/9551316/116024345-634dab00-a624-11eb-8c81-20016f4b339b.mp4

EDIT: with binding.pry it works but it looks a little weird on emacs, do you have any tip to improve binding pry on emacs ?

dgutov commented 3 years ago

Thanks, I see it now. I just tried binding.pry. byebug indeed does something that stops requests/responses going through. Not sure how to fix it, or at least not yet.

do you have any tip to improve binding pry on emacs ?

Perhaps https://github.com/deivid-rodriguez/pry-byebug? It adds stepping commands and even breakpoint functionality.