Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 no immediate auto completion for auto declared var
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bta
Ketchup Master

Belgium
57 Posts

Posted - Feb 20 2015 :  02:24:53 AM  Show Profile  Reply with Quote
Hi,

it seems that when a variable is declared as auto the autocompletion suggestion listbox does not immediately pop up when typing in the .

Consider this piece of code:

class X
   {
   public:
      explicit X(bool enable) : m_enabled(enable)
         {
         }
      bool isEnabled() const
         {
         return m_enabled;
         }
      void disable() { m_enabled=false;}
   private:
      bool m_enabled;
   };

void foo()
   {
   auto autoX = X{false};
   X expX(false);
   autoX.isEnabled();   // when typing the . the suggestion listbox does not popup
   expX.isEnabled();    // when typing the . the suggestion listbox nicely pops up
   }


It seems that if you start typing a character after the '.' that is contained in a method/member (in this case for example an 'e'), then it shows the popup.
When you type in a character that is not contained in a method/member (in this case for example a 'z'), then the popup is not shown. However when you then use the backspace key to remove the 'z', the popup is shown.

Bart

versioning info:

VA_X.dll file version 10.9.2059.0 built 2015.02.11
DevEnv.exe version 12.0.30723.0 Professional
msenv.dll version 12.0.30723.0
Comctl32.dll version 6.10.7601.17514
Windows 7 6.1 Build 7601 Service Pack 1

feline
Whole Tomato Software

United Kingdom
19137 Posts

Posted - Feb 20 2015 :  2:24:35 PM  Show Profile  Reply with Quote
Do you have:

VA Options -> Listboxes -> Get content from default Intellisense

turned On or Off? Turning this on helps for me, and I am getting the listbox immediately in both cases.

Looking more closely, this problem is being triggered by the "{ false }" at the end of the line:

auto autoX = X{false};

what is happening here? Obviously this is being passed to the constructor, but why the curly braces? This compiles in VS2013, but not in VS2012, so its a new behaviour, but not one that I recognise.

zen is the art of being at one with the two'ness
Go to Top of Page

bta
Ketchup Master

Belgium
57 Posts

Posted - Mar 10 2015 :  08:01:12 AM  Show Profile  Reply with Quote
I do not have the "Get content from default Intellisense" turned on.
I even have intellisense turned off completely and rely on VAX only.

What this is about is combination of auto keyword with uniform initialization. See for example:
http://herbsutter.com/2013/05/09/gotw-1-solution/

Bart
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19137 Posts

Posted - Mar 10 2015 :  10:19:59 PM  Show Profile  Reply with Quote
The link helps, thank you. I was not sure what was going on here at first, always something new to learn. I have put a bug report in for this:

case=88017

For now, if you either use () instead of {} when initializing the new variable, or use the full type instead of auto this should work correctly. I was only seeing a problem with both auto and {}. Hopefully this will help you work around this problem until we can fix it.

zen is the art of being at one with the two'ness
Go to Top of Page

Adequat
Tomato Guru

182 Posts

Posted - Mar 31 2015 :  03:35:21 AM  Show Profile  Reply with Quote
I am using more and more the 'auto' keyword in C++. Unfortunately, I can see that your C++ parser, who generally shines, often fails to auto-complete properly when a type is used :(
Any plan to improve VA to better handle the 'auto' keyword?
I am not using Intellisense.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19137 Posts

Posted - Apr 04 2015 :  5:15:32 PM  Show Profile  Reply with Quote
Do you have any code samples that show problems you are having? I worked out a work around for the specific problem first mentioned here.

We are working on fixing problems and improving our parser, but we need to know what goes wrong so we work on it.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000