Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: NON on May 28, 2014, 01:03:27 pm

Title: Call tip and autocomplete for auto type
Post by: NON on May 28, 2014, 01:03:27 pm
I'm using Code::Blocks 13.12, and it seems call tip and autocomplete is not working for variables declared with C++11 auto type?

Example with explicit type:
Code
MyType* thing = new MyType;
thing-> //after typing "->", a list of call tips pops up (usually)

Example with auto type:
Code
auto thing = new MyType;
thing-> //no call tips pops up after typing "->"

Are there any plans to implement call tip and autocomplete for auto types? Or is there some plugin or setting which allow this alrady?

From what I can tell, several IDEs already support this (Visual Studio 201x, Eclipse, Qt Creator 2.7.0, KDevelop 4.5.1). See this question on stackoverflow:
http://stackoverflow.com/questions/19625115/which-ides-and-text-editors-can-deduce-type-of-variables-declared-using-auto-key (http://stackoverflow.com/questions/19625115/which-ides-and-text-editors-can-deduce-type-of-variables-declared-using-auto-key)

I think the auto feature is a very useful addition for several reasons, and I've already replaced a bunch of explicit type names with auto in my project. But it's a pity that the call tips don't show up there anymore.

Code::Blocks is my favorite IDE and I don't want to change to any of the other's I mentioned above. If there is some indication that call tips and autocomplete for auto types is going to be fixed soon-ish, I'll just hold out without call tips until then :)
Title: Re: Call tip and autocomplete for auto type
Post by: NON on July 28, 2014, 06:18:50 pm
No?
Title: Re: Call tip and autocomplete for auto type
Post by: oBFusCATed on July 28, 2014, 09:32:10 pm
I don't think there are plans to implement auto in our parser anytime soon. Probably you can try Alpha's clang based code completion plugin...
Title: Re: Call tip and autocomplete for auto type
Post by: BlueHazzard on July 28, 2014, 11:36:48 pm
I don't think there are plans to implement auto in our parser anytime soon. Probably you can try Alpha's clang based code completion plugin...
As oBFusCATed says the closest is the clang based code completion (http://forums.codeblocks.org/index.php/topic,18785.0.html)... writing a c++ parser is close to cooling the hell, the c::b team is really happy for any improvement patch ;)

greetings
Title: Re: Call tip and autocomplete for auto type
Post by: Alpha on July 29, 2014, 03:53:36 am
The Clang plugin does handle auto just fine.  (However, note that this plugin is not production ready.  It can lag, freeze, and crash if you are unlucky.  I consider it functional, but use it with caution.)
I have not had time to do development on this plugin recently, but hopefully I will be able to start up again soon.  Clang has a lot of potential.