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
Patch to support "extended completion"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
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   Translate to Translated (View Original)
 More options Apr 27 2010, 9:57 pm
From: "Jasper St. Pierre" <jstpie...@mecheye.net>
Date: Tue, 27 Apr 2010 21:57:10 -0400
Local: Tues, Apr 27 2010 9:57 pm
Subject: Patch to support "extended completion"

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)


 
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.
Ali Gholami Rudi  
View profile  
 More options Apr 28 2010, 11:44 pm
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Thu, 29 Apr 2010 08:14:57 +0430
Local: Wed, Apr 28 2010 11:44 pm
Subject: Re: Patch to support "extended completion"
Hi Jasper,

"Jasper St. Pierre" <jstpie...@mecheye.net> wrote:

It looks good.  I think the main difference with ropevim's
extended_completions is that, ropevim handles the completions
on python-side while you want to do that on emacs-side so
your patch seems a lot simpler.

Thanks,
Ali


 
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.
Darren Hoo  
View profile  
 More options Apr 29 2010, 3:19 am
From: Darren Hoo <darren....@gmail.com>
Date: Thu, 29 Apr 2010 15:19:56 +0800
Local: Thurs, Apr 29 2010 3:19 am
Subject: Re: Patch to support "extended completion"
Hi,

On Wed, Apr 28, 2010 at 9:57 AM, Jasper St. Pierre

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.
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/>


 
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.
Ali Gholami Rudi  
View profile  
 More options Apr 29 2010, 7:53 am
From: Ali Gholami Rudi <aligr...@gmail.com>
Date: Thu, 29 Apr 2010 16:23:07 +0430
Local: Thurs, Apr 29 2010 7:53 am
Subject: Re: Patch to support "extended completion"
Hi,

"Jasper St. Pierre" <jstpie...@mecheye.net> wrote:

angri, would you have a look at this?

Thanks,
Ali


 
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.
general  
View profile  
 More options Apr 30 2010, 2:03 pm
From: general <gene...@angri.ru>
Date: Fri, 30 Apr 2010 22:03:25 +0400
Local: Fri, Apr 30 2010 2:03 pm
Subject: Re: Patch to support "extended completion"
Applied.

Thanks!

--
angri

2010/4/29 Ali Gholami Rudi <aligr...@gmail.com>:


 
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.
Jasper St. Pierre  
View profile  
 More options May 1 2010, 3:02 am
From: "Jasper St. Pierre" <jstpie...@mecheye.net>
Date: Sat, 1 May 2010 03:02:02 -0400
Local: Sat, May 1 2010 3:02 am
Subject: Re: Patch to support "extended completion"

And it would help if I actually put the correct address in here.

On Sat, May 1, 2010 at 3:01 AM, Jasper St. Pierre <jstpie...@mecheye.net>wrote:


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »