Re: Cedet Semantic does not show overloaded functions in either: semantic-ia-complete-symbol-menu OR autocomplete-text after period

Eric Ludlam <[email protected]> Wed, 26 Nov 2014 12:20:16 -0500
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
Hi Dixon,

You can use the function:

M-x semantic-ia-show-variants RET

to show all the variants available with the same name.

What happens when you are doing completions is up the the completion UI 
engine.  The core routine `semantic-analyze-possible-completions' takes 
arguments that will allow it to return all the variants if desired.

I don't do too much with my functions `semantic-ia-complete-symbol-menu' 
etc as there are other things like company-mode and autocomplete where 
the author spends much more time one what keypresses should do than I do.

That said, if you think the menu should show the variants, and would 
like to provide a patch for a better version, that is fine with me.  The 
code should be a very simple change if you look at how 'show variants' 
works vs the menu function.  Probably just adding a couple symbols as 
below untested patch.  Doing the same to the completion-tip might be 
nice too.  I'd recommend trying it out for a while and make sure it 
doesn't drive you batty first though.  :)

Eric

=== modified file 'lisp/cedet/semantic/ia.el'
*** lisp/cedet/semantic/ia.el	2014-11-09 20:23:30 +0000
--- lisp/cedet/semantic/ia.el	2014-11-26 17:17:44 +0000
***************
*** 157,163 ****
     (interactive "d")
     (require 'imenu)
     (let* ((a (semantic-analyze-current-context point))
! 	 (syms (semantic-analyze-possible-completions a))
   	 )
       ;; Complete this symbol.
       (if (not syms)
--- 157,163 ----
     (interactive "d")
     (require 'imenu)
     (let* ((a (semantic-analyze-current-context point))
! 	 (syms (semantic-analyze-possible-completions a 'no-unique 'no-tc))
   	 )
       ;; Complete this symbol.
       (if (not syms)




On 11/25/2014 09:23 AM, Dixon Ryan (ETAS/ESW6) wrote:
> Hi all,
>
> CEDET Semantic does not provide a completion list of overloaded functions:
>
> I have F11 on my keyboard:
>
> /(define-key global-map [f11]/
>
> /  '(lambda ()/
>
> /    (interactive)/
>
> /    (semantic-force-refresh)/
>
> /    (semantic-ia-complete-symbol-menu nil)))/
>
> ** It would be nice for the autocomplete highlighted signature name to
> also include the expected parameters. As it stands, it makes sense that
> I would only get one function (from a set of overloaded functions)
> because the autocomplete only shows the NAME of the function. EG:
>
> mc.myFunc // I can tab as much as I want, I only get myFunc even if
> there are 3.
>
> But, if autocomplete went:
>
> mc.myFunc ( std::string s ) //Then I tab and get:
>
> mc.myFunc ( int x ) //Then I tab and get:
>
> my.myFunc ( void ) // This would be nice.
>
> Though this does mean that the user then needs to delete the int /
> std::string or void. Maybe instead autocomplete can just show the name
> of the parameter. Eg:
>
> mc.myFunc ( s ) //  INSTEAD OF
>
> mc.myFunc ( std::string s )
>
> ===
>
> So, that was about autocomplete and the drop-down-menu. The
> drop-down-menu already shows the parameters, which is excellent. It just
> doesn’t show all the overloaded methods.
>
> Here are the project files which prove this issue:
>
> ===main.cpp===
>
> #include "MyClass.hpp"
>
> int main( void ) {
>
>     MyClass mc;
>
>     mc. // no overloaded functions (the first one in public)
>
>     return 0;
>
> }
>
> ===END main.cpp===
>
> ===MyClass.hpp===
>
> #include <string>
>
> class MyClass {
>
> public:
>
>     void myFunc( void ) const;
>
>     void myFunc( int x ) const;
>
>     void myFunc( std::string s ) const;
>
> private:
>
>     int data;
>
> };
>
> ===END MyClass.hpp===
>
> ===MyClass.cpp===
>
> #include "MyClass.hpp"
>
> void MyClass::myFunc( void ) const {
>
>     ;
>
> }
>
> void MyClass::myFunc( std::string s ) const {
>
>     ;
>
> }
>
> void MyClass::myFunc( int x ) const {
>
>     ;
>
> }
>
> ===END MyClass.cpp===
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> cedet-semantic mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cedet-semantic
>

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk