I want to use something like rope-get-calltip which returns the calltip as a string so that I can hook it up in eldoc to automatically show calltips.
It would be nice if it also returns the index of the current arg. For example, if foo has signature foo(x, y, z), when I am typing foo(1, |) where | indicates where cursor is, the index is 1 (counting from 0).
Sure. Write a patch and I'm sure agr will take it.
On Sun, Feb 5, 2012 at 1:44 AM, Leo <sdl....@gmail.com> wrote: > Hello,
> I want to use something like rope-get-calltip which returns the calltip > as a string so that I can hook it up in eldoc to automatically show > calltips.
> It would be nice if it also returns the index of the current arg. For > example, if foo has signature foo(x, y, z), when I am typing foo(1, |) > where | indicates where cursor is, the index is 1 (counting from 0).
> On Sun, Feb 5, 2012 at 1:44 AM, Leo <sdl....@gmail.com> wrote: > > I want to use something like rope-get-calltip which returns the calltip > > as a string so that I can hook it up in eldoc to automatically show > > calltips.
> > It would be nice if it also returns the index of the current arg. For > > example, if foo has signature foo(x, y, z), when I am typing foo(1, |) > > where | indicates where cursor is, the index is 1 (counting from 0).
> > Could this be implemented upstream? Thanks.
Another solution is to write a lisp function that uses rope-get-calltip; this doesn't require changing ropemode. But I'm not sure which of them are cleaner. Please report any success.
"Jasper St. Pierre" <jstpie...@mecheye.net> wrote:
> Sure. Write a patch and I'm sure agr will take it.
Certainly, any patch is welcome. By the way, Anton maintains ropemacs too, so he takes the patches.
On 2012-02-06 00:02 +0800, Ali Gholami Rudi wrote:
> Another solution is to write a lisp function that uses > rope-get-calltip; this doesn't require changing ropemode. > But I'm not sure which of them are cleaner. Please > report any success.
But this feels backwards. I think if rope-get-calltip is defined then rope-show-calltip will be straightforward to define in elisp. Just like rope-show-doc can be easily re-implemented in elisp using rope-get-doc.
BTW, rope-show-calltip fails on the following example code:
os.path.join\ ('a', 'b')
> "Jasper St. Pierre" <jstpie...@mecheye.net> wrote: >> Sure. Write a patch and I'm sure agr will take it.
> Certainly, any patch is welcome. By the way, Anton maintains > ropemacs too, so he takes the patches.
Leo <sdl....@gmail.com> wrote: > On 2012-02-06 00:02 +0800, Ali Gholami Rudi wrote: > > Another solution is to write a lisp function that uses > > rope-get-calltip; this doesn't require changing ropemode. > > But I'm not sure which of them are cleaner. Please > > report any success.
> But this feels backwards. I think if rope-get-calltip is defined then > rope-show-calltip will be straightforward to define in elisp. Just like > rope-show-doc can be easily re-implemented in elisp using rope-get-doc.
Changing ropemacs is a bit harder as you may need to change ropemode and possibly ropevim (but the latter is very unlikely). But I may be wrong. Do you have a patch?
> BTW, rope-show-calltip fails on the following example code:
> os.path.join\ > ('a', 'b')
You can change show_calltip() in ropemode/interface.py for handling that; just skip any whitespace and newlines following backslashes. But personally I think this is not PEP8 compatible and safe to ignore.
Yes, by setting eldoc-documentation-function locally in python mode.
>> But this feels backwards. I think if rope-get-calltip is defined then >> rope-show-calltip will be straightforward to define in elisp. Just like >> rope-show-doc can be easily re-implemented in elisp using rope-get-doc.
> Changing ropemacs is a bit harder as you may need to change > ropemode and possibly ropevim (but the latter is very unlikely). > But I may be wrong. Do you have a patch?
Leo <sdl....@gmail.com> wrote: > On 2012-02-08 10:53 +0800, Leo wrote: > > Indeed. Thanks for the cleanup. I have re-worked the patch to be on top > > of yours. How to get these two patches installed upstream? Thanks.
> I forgot to mention that I have tested these patches and they worked.