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
 C++ Structured Bindings Autocomplete
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

marovira
Junior Member

10 Posts

Posted - Feb 15 2021 :  02:06:40 AM  Show Profile  Reply with Quote
I'm using Visual Studio 2019 Community 16.8.5 with Visual Assist version 10.9.2399.0. Currently, whenever I use structured bindings in C++, the autocomplete from Visual Assist is not able to complete the elements of the binding as I type. For example, consider the following:

struct Params
{
    int var_a{0};
    int var_b{1};
};

void print_params(Params const& params)
{
    auto& [var_a, var_b] = params;
    int foo = var_a; // autocomplete cannot fill in var_a.
    std::cout << var_b; // same here, it cannot fill in var_b.
}


I encounter this issue quite frequently in the code and can make development more difficult as I cannot autocomplete variable names. Hovering over the variables does work and will produce the correct types. The issue only appears while typing. Does Visual Assist support autocomplete with structured bindings? If not, is this a planned feature?

Interestingly enough, if I disable Visual Assist, Intellisense is able to autocomplete the elements of the binding. If Visual Assist doesn't support them yet, is there a way of getting the results from Intellisense to show in the suggestion lists?

feline
Whole Tomato Software

United Kingdom
17186 Posts

Posted - Feb 15 2021 :  09:56:33 AM  Show Profile  Reply with Quote
Unfortunately VA does not currently understand C++ 17 structured bindings. This is something we are hoping to fix fairly soon, but I don't currently have an accurate estimate for when this will be done:

case=113210

Assuming you have set:

VA Options -> Enhanced Listboxes -> Source of C/C++ content: Default Intellisense

then the "full" listboxes will suggest the symbol names. However, if you have VA suggestions enabled then you will mainly be seeing VA suggestion listboxes, that won't suggest these symbols. You can go from a suggestion listbox to a full listbox by pressing CTRL-SPACE, or you can disable the VA suggestion listboxes via:

VA Options -> Suggestions -> Suggestion and Completion lists -> Enable in C++

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

marovira
Junior Member

10 Posts

Posted - Feb 15 2021 :  1:06:09 PM  Show Profile  Reply with Quote
Thanks for the quick reply! Hopefully this gets fixed soon.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000