Giter Site home page Giter Site logo

Comments (9)

dgutov avatar dgutov commented on May 17, 2024

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.

bassu avatar bassu commented on May 17, 2024

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.

dgutov avatar dgutov commented on May 17, 2024

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.

bassu avatar bassu commented on May 17, 2024

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.

dgutov avatar dgutov commented on May 17, 2024

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.

bassu avatar bassu commented on May 17, 2024

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.

dgutov avatar dgutov commented on May 17, 2024

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.

bassu avatar bassu commented on May 17, 2024

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.

dgutov avatar dgutov commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.