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
 Failing case 2 - no IntelliSense suggestion shown
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jkmgs
Junior Member

Austria
15 Posts

Posted - Nov 27 2023 :  04:34:54 AM  Show Profile  Reply with Quote
Hi,

I found another case where the IntelliSense suggestion of Visual Assist is not working as expected. I created an example showcasing the issue:
------------------
#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>

class Part {
public:
  double Start_{ };
  double End_{ };
};

void GetParts() {
  std::vector<Part> Parts_{};
  auto display_start_x = 10.0;
  auto display_end_x = 15.0;

  auto start_it = std::find_if(Parts_.begin(), Parts_.end(), [display_start_x, display_end_x](const Part& part) { return part.End_ >= display_start_x && part.Start_ <= display_end_x; });
  auto end_it = std::find_if(start_it, Parts_.end(), [display_end_x](const Part& part) { return part.Start_ > display_end_x; });

  for (; start_it != end_it; start_it++)
  {
    // type "start_it->" in the line after this comment and press CTRL+Space to force showing IntelliSense -> nothing is shown for me here as long as Visual Assist is enabled. Disabling Visual Assist results in auto-completion items being shown in this case.
  }
}

int main()
{
    std::cout << "Hello World!\n";
    GetParts();
}
------------------
I already updated to the latest Visual Assist version 2023.6.

I also retested my old issue, which also still isn't showing any suggestions with the new version: https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=20539

If you disable Visual Assist and only rely on VS IntelliSense, both cases will work perfectly. However, it is not a good solution to have to constantly switch Visual Assist on and off from case to case.

All the best,
Johannes



Edited by - jkmgs on Nov 27 2023 04:38:54 AM

feline
Whole Tomato Software

United Kingdom
18934 Posts

Posted - Nov 27 2023 :  07:20:09 AM  Show Profile  Reply with Quote
If you have the time, can you please try this sample code in a new C++ console solution?

I am seeing a listbox appear automatically when I type the -> after "start_it", with virtually no delay at all, and I am not having to do anything to trigger it.

Interestingly I am getting tomato icons on the listbox, but if I disable IDE intellisense, no listbox. So despite the icons, IDE intellisense is part of why I am getting the listbox. If you get the same behaviour in a new default solution would you be able to send me your VA and IDE settings, so I can try and figure out if this is a settings effect:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

Please send me the files via email:

[email protected]

including this thread ID or URL in the description, so we can match it up.

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

jkmgs
Junior Member

Austria
15 Posts

Posted - Nov 27 2023 :  07:40:43 AM  Show Profile  Reply with Quote
I just tried my sample code in a new C++ console solution in VS 2022. This resulted in the same outcome as before.

I sent you the requested files per email.

A suggestion for the settings export: It would be great if there was a button to open the folder to which the settings were exported when exporting the settings. Currently it just shows the path where the .reg file is stored and I have to type it manually into the location bar in a new explorer window.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18934 Posts

Posted - Nov 27 2023 :  09:49:34 AM  Show Profile  Reply with Quote
I have the settings files, thank you for these. I am seeing the same problem with you VA settings. No listbox even when pressing CTRL-SPACE.

For me, the fix is setting:

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

assuming you have IDE intellisense enabled. With this set, the listbox appears automatically and immediately. Can you please try this and see if you get the same result?

As for getting to the exported settings easier, agreed, this could be done better:

case=141962

I am going to prod this code a bit, not sure why VA isn't working out the return type of std::find_if(), since in this example it should be the same type as either of the first two parameters, if I understand this correctly.

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

jkmgs
Junior Member

Austria
15 Posts

Posted - Nov 28 2023 :  03:51:40 AM  Show Profile  Reply with Quote
You are sincerely welcome!

Yes, I get the same result when switching the Source of C/C++ content to "Default Intellisense". Is it better to stay at the "Default Intellisense" setting?

Thank you for creating a case for this request as well.

That is correct, start_it and end_it should be recognized as "std::vector<Part>::iterator" type in this case due to the type of iterators provided to the std::find_if() method.
I am looking forward to your results!

Edited by - jkmgs on Nov 28 2023 03:53:59 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18934 Posts

Posted - Nov 28 2023 :  10:40:32 AM  Show Profile  Reply with Quote
After some fiddling around, I have found a work around that fixes VA's understanding of "std::find()", but so far I cannot get that work around to work on "std::find_if()" so it doesn't actually help much here. I have put in a bug report, along with the work arounds, for this:

case=163907

Generally we do recommend setting the source of C/C++ content to default intellisense, if you have the IDE parser enabled. It really depends on your codebase though, sometimes the IDE gives better results, sometimes VA gives better results. So one of those try it and see situations

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

jkmgs
Junior Member

Austria
15 Posts

Posted - Nov 29 2023 :  04:43:11 AM  Show Profile  Reply with Quote
Glad to hear that, seems you're already halfway there! I hope this can be solved fully in the future. Thanks for putting in the effort!

I prefer to chose one and stick to that if possible - I assume most customers do it like that given that there is no quick way (= one button click) to change that setting. But if one of both solutions works great for my current project, then I am already pleased. So I will stick for now with the default IntelliSense and see how that works out over the next weeks. :)

One other question I have now is the following: my IntelliSense slowed down by a lot, especially the time it took for the suggestion-listbox to appear. Here in this forum I managed to find a solution for that: deleting the .vs folder (which also happened to delete my default-startup-project-setting, so be aware), which already was over 27 GB in size. After recreation, it was around 1,5 GB, so that's huge. Is this Visual Studio's fault? You have the "Rebuild Symbol Databases" and "Clear History, cache and temporary files" buttons in the VA Options - Performance. I did use that in the past many times. Therefore it's clearly not cleaning up the .vs folder. Might this (another button that cleans up the .vs folder) be something that would make sense, given it actually influences the time it takes for the listbox to appear by a lot?

Edited by - jkmgs on Nov 29 2023 05:02:45 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18934 Posts

Posted - Nov 29 2023 :  05:55:46 AM  Show Profile  Reply with Quote
What should happen, with the setting:

VA Options -> Enhanced Listboxes -> Source of C/C++ content: Visual Assist

is that if the IDE cannot provide any content for the listbox, we will detect that and provide our own information. It is just we ask the IDE first, instead of trying to fill it ourselves first. So assuming the IDE intellisense is producing the correct results for your solution, this should produce solid results for you.

For the IDE and VA intellisense databases, they are quite separate and stored in separate locations. So telling the IDE or VA to rebuild won't have any effect on the other.

Yes, deleting the entire ".vs" directory does take out some solution settings, like the open tabs, so its not the best plan, but its certainly an option, since everything there gets recreated. To tell the IDE you want it to rebuild its intellisense database you can set:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Advanced -> Recreate Database = True

I think this then requires an IDE restart to take effect, but I am not certain off the top of my head.

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