Comments (9)
the autocomplete doesn't list the method info or accepted parameters in the mini buffer
I believe you're referring to calltips. In Emacs, they're usually implemented with ElDoc and work separately from code completion.
I use Jedi.el for Python and it shows the function attributes no matter how and where exactly a particular Class is defined, when creating new instances!
emacs-jedi
does it a bit differently, but robe-eldoc
should work in this case, too. It does for me.
Is Foo
defined in Ruby and loaded in the console? What happens if you put the cursor between the parens, in Foo.new()
? What if you type a character, or press SPC, and wait? If nothing happens, what does (robe-eldoc)
return when evaluated at that point?
If the answer to the above questions is "nothing", switch to the console (C-c C-z
) and try evaluating this: Foo.instance_method(:initialize).parameters
(after substituting in the actual class name).
from robe.
Ah yes, I was referring to call tips
. Sorry, didn't remember the exact term! LOL.
After loading the said class into console, robe-eldoc
returns eldoc error: (end-of-file)
with below error in the console.
ERROR -- : Request failed: /doc_for/Foo/yes/initialize. Please file an issue.
E, [2013-12-15T09:06:45.828317 #22580] ERROR -- : Could not load source for : No such file or directory - (irb)
~/.gem/ruby/2.0.0/gems/method_source-0.8.2/lib/method_source.rb:55:in `rescue in lines_for'
~/.gem/ruby/2.0.0/gems/method_source-0.8.2/lib/method_source.rb:52:in `lines_for'
~/.gem/ruby/2.0.0/gems/method_source-0.8.2/lib/method_source.rb:42:in `comment_helper'
~/.gem/ruby/2.0.0/gems/method_source-0.8.2/lib/method_source.rb:122:in `comment'
~/.gem/ruby/2.0.0/gems/pry-0.9.12.4/lib/pry/method.rb:308:in `doc'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/sash/doc_for.rb:43:in `method_struct'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/sash/doc_for.rb:16:in `format'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/sash.rb:85:in `doc_for'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/sash.rb:168:in `public_send'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/sash.rb:168:in `call'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/server.rb:40:in `block in start'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/server.rb:28:in `loop'
~/.emacs.d/elpa/robe-20131210.641/lib/robe/server.rb:28:in `start'
~/.emacs.d/elpa/robe-20131210.641/lib/robe.rb:18:in `block in start'
For the second part, after restarting the console buffer, and executing Foo.instance_method(:initialize).parameters
, it returns the correct amount of parameters (in a two 2d array):
[[:name, :address]]
from robe.
robe-eldoc returns eldoc error: (end-of-file) with below error in the console
Hmm, the error should be fixable, but how did you load the class into console? Did you just define it there? If it's defined in some file, you should use C-c C-l, so that the information about the locations and docs of this class's methods is preserved.
[[:name, :address]]
Hopefully, it's more like [[:req, :name], [:req, :address]]
. :)
from robe.
Did you just define it there? If it's defined in some file, you should use C-c C-l, so that the information about the locations and docs of this class's methods is preserved.
I was doing C-x C-w
between the buffers. C-c C-l
is what I was missing, as it appears.
Thanks! That did the trick.
Last question though. Is there a way to automate it on the fly as Classes are written and/or files required
?
Hopefully, it's more like [[:req, :name], [:req, :address]]. :)
Indeed. I just tried to shorten it ;)
from robe.
C-x C-w
M-w
, C-y
? :)
Is there a way to automate it on the fly as Classes are written and/or files required?
If you're using Rails, then yes, C-c C-k (like README says, use describe-package
to see the list of commands). Otherwise, no.
from robe.
C-x C-w
Seems like switching buffer got mixed in the typo. I meant, M-w C-x o C-y
.
LOL. I am too sleepy to type!
If you're using Rails, then yes, C-c C-k (like README says, use describe-package to see the list of commands). Otherwise, no.
Haha. You got me again. I am not using Rails as of now but only using Ruby (am still in the middle of the Pickaxe2 book and pacing my way there).
Thanks for the quick response and yet sorry for the noise! I would appreciate if you can document the Rails requirement and a bit more needed info in README, if and when you get a chance - so starters like me can use it too!
from robe.
I meant, M-w C-x o C-y.
Maybe you won't need it now, but inf-ruby also has a command for sending the region to subprocess: C-c C-r
.
still in the middle of the Pickaxe2 book and pacing my way there
Eh, everyone says don't pick up a new editor and a new language at the same time, but if you can pull it off, more power to you. :)
if you can document the Rails requirement and a bit more needed info in README
Updated. But it's definitely not a requirement, reloading is just something Rails makes easier, and I'm not sure if there are similar features in any other frameworks or libraries that we could use.
By the way, I haven't been using Rails myself for a while now. The big project at my day job is on Goliath + Grape.
from robe.
Eh, everyone says don't pick up a new editor and a new language at the same time, but if you can pull it off, more power to you. :)
Well the counterpart vim is rough and dry for me so may be yes, but the Emacs magic is already working, at least with default Python mode and Jedi (wrote one big single filed tool ZFS replication for sysop).
Though I don't plan on diving into Elisp sometime soon but I guess one cannot live without it for long, which brings me to a slight off topic question, what do you recommend for learning Elisp, if you may :)?
Updated. But it's definitely not a requirement
You rock!
By the way, I haven't been using Rails myself for a while now. The big project at my day job is on Goliath + Grape.
Thanks (as usual) for mentioning. Grape sounds cool for few starting pet projects I have! I'll check it out.
from robe.
No problem.
Well the counterpart vim is rough and dry for me so may be yes
The alternative would be to use something trendy like Sublime or RubyMine. But, of course, neither of those is free software, so far be it from me to recommend them. :)
wrote one big single filed tool ZFS replication for sysop
Looks neat, though I'm not qualified to judge it on merits of functionality. AFAICS, it could use some tests. :)
what do you recommend for learning Elisp, if you may :)?
Like with any language, I recommend reading (and then contributing to :)) real-life code, in core and third-party packages. It may be harder in some environments, but Emacs makes it very easy to see what a given function is doing.
So:
http://www.gnu.org/software/emacs/manual/html_node/eintr/
http://www.emacswiki.org/emacs-en/SelfDocumentation
Then add (find-function-setup-keys)
to your init file, read its source to see what it's doing, and off you go. :)
from robe.
Related Issues (20)
- Cannot load such file pry HOT 2
- Is there a way to show docs in completions popup/eldoc summary? HOT 1
- Autocompletion not working? HOT 1
- Stuck at cpu 100% HOT 6
- Robe cannot autostart: "No matching directory found" HOT 4
- Robe not working on Ruby 2.7.1 HOT 3
- robe make emacs freeze on 27 on large projects HOT 16
- Non-string path in LOAD_PATH HOT 3
- Emacs freezes when robe is called while byebug is active on console HOT 3
- How to disable robe? HOT 2
- Get search failed message when run robe-jump. HOT 19
- `Can't find the location` when try to search a class defined on current project. (but can in irb) HOT 6
- `find-tag-marker-ring` breaks `robe-jump` on Emacs 28. HOT 2
- Environment variables HOT 1
- Can't jump to the nested module's class in `enh-ruby-mode`, but ruby-mode works HOT 29
- robe-jump returns error file doesnt exists - but it exists HOT 11
- [Help Request] Not robe issue, just need some professional help on crystal-mode. HOT 10
- CPU spikes during rails process buffer completion HOT 7
- Allow for configurable specificity of `robe-jump` entries HOT 9
- Should be possible to change Robe errors buffer from inf-ruby buffer to another buffer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robe.