Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Patch to support "extended completion"
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jasper St. Pierre  
View profile  
 More options Apr 29 2010, 4:03 am
From: "Jasper St. Pierre" <jstpie...@mecheye.net>
Date: Thu, 29 Apr 2010 04:03:59 -0400
Local: Thurs, Apr 29 2010 4:03 am
Subject: Re: Patch to support "extended completion"

It's currently in here:

http://github.com/magcius/auto-complete/

Which I will try to get upstream as soon as the patch is integrated.
<http://github.com/magcius/auto-complete/>

On Thu, Apr 29, 2010 at 3:19 AM, Darren Hoo <darren....@gmail.com> wrote:
> Hi,

> On Wed, Apr 28, 2010 at 9:57 AM, Jasper St. Pierre
> <jstpie...@mecheye.net> wrote:
> > I am currently in the process of making a ropemacs auto-complete backend.
> > Here is the patch to support that:
> > diff -r 364ab6aeb8e9 ropemode/interface.py
> > --- a/ropemode/interface.py Tue Apr 27 19:53:45 2010 +0400
> > +++ b/ropemode/interface.py Tue Apr 27 21:55:06 2010 -0400
> > @@ -272,6 +272,10 @@
> >      def completions(self):
> >          return _CodeAssist(self, self.env).completions()

> > +    @decorators.local_command()
> > +    def extended_completions(self):
> > +        return _CodeAssist(self, self.env).extended_completions()
> > +
> >      def _check_autoimport(self):
> >          self._check_project()
> >          if self.autoimport is None:
> > @@ -590,6 +594,12 @@
> >          return [self.env._completion_text(proposal)[prefix:]
> >                  for proposal in proposals]

> > +    def extended_completions(self):
> > +        proposals = self._calculate_proposals()
> > +        prefix = self.offset - self.starting_offset
> > +        return [[proposal.name[prefix:], proposal.get_doc(),
> > + proposal.type] for proposal in proposals]
> > +
> >      def _apply_assist(self, assist):
> >          if ' : ' in assist:
> >              name, module = assist.rsplit(' : ', 1)

> this patch works for me.

> People who use company-mode can use this patch to make
> of this extended complete, the info will show in the echo area

> --- company-ropemacs.new.el     2010-04-29 14:55:24.766121479 +0800
> +++ company-ropemacs.el 2010-04-29 14:56:15.000000000 +0800
> @@ -63,6 +63,9 @@
>                   (company-ropemacs--grab-symbol)))
>     ('candidates (mapcar (lambda (element) (concat arg element))
>                          (rope-completions)))
> +    ('meta (let* ((completions (rope-extended-completions))
> +                 (match (assoc arg completions)))
> +            (concat (propertize arg 'face 'font-lock-doc-face) ": " (caddr
> match))))
>     ('doc-buffer (company-ropemacs-doc-buffer arg))
>     ('location (company-ropemacs-location arg))))

> there's one nuisance here, that is if the completion is an instance
> for example if it is a string , it will return the documentation of
> string class ,I think this is too much verbose, return something like
> "type String" will be enough IMHO. so I have not added doc in
> the above patch, add it if  that's ok for  you. also you can press
> F1 on the selected completion candidate to get docuementation of
> it in company-mode.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.