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
 Problems with parsing bit fields
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tomob
Junior Member

Poland
10 Posts

Posted - Nov 25 2024 :  3:43:11 PM  Show Profile  Reply with Quote
Hi,

I found that Visual Assist has problems with autocompleting fields of a struct if it contains bit fields. In my case it autocompletes only the fields that are set as bitfields and misses every other field in a struct.

Here's an example:

struct FJournalSection
{
	uint32 Magic;
	uint32 Version : 30;
	uint32 Priority : 2;
	uint32 Hash;
	uint32 Offset;
	uint32 Size;
};

FJournalSection FirstSection = ReadSection();

int32 SectionSize = FirstSection.Size;



At the time when I type in "FirstSection." I would expect VAX to show me all the fields from the FJournalSection, but instead it shows only Version and Priority. If I set Hash to be a bit field as well then it shows the three bit fields: Version, Priority and Hash.

However it doesn't have problems navigating to fields that are not bit-fields.
For what it's worth this is an Unreal Engine project solution.

My version is 10.9.2537.0 built 2024.10.27

Regards,
Tomek

feline
Whole Tomato Software

United Kingdom
19039 Posts

Posted - Nov 26 2024 :  10:01:40 AM  Show Profile  Reply with Quote
Testing this here, in just a normal solution, not an Unreal Engine project, no sign of the problem. All 6 members are being listed for me. This is testing with IDE Intellisense disabled via:

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

so I know the listbox is coming from VA.

On the line where you are seeing the problem, if you place the keyboard caret into "FirstSection" what, if anything, is shown in VA's context and definition field? I am wondering if VA is correctly identifying the type of this variable. If it isn't that might explain the problem.

Assuming VA is showing something that looks correct, what do you get if you use Alt-Shift-G for Goto Related on "FirstSection", and then show the "Goto Member..." dialog? Are all of the members shown here?

And I am getting the same results, all 6 members listed, in an Unreal Engine solution as well. So I suspect the trigger is something else, but I am not sure what.

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

tomob
Junior Member

Poland
10 Posts

Posted - Dec 10 2024 :  06:26:38 AM  Show Profile  Reply with Quote
Hey,

After your suggestions the issue went away and it took me a long time to reproduce it, but it started happening again. I noticed that this happens when I switch multiple times between platform configurations debugging on different dev kits. Sometimes it goes away when switching back to a Win64 (an Unreal target) configuration, but not always. It happens with both Intellisense disabled/enabled and VA being the main source of C/C++ content. What's interesting is that if I disable VA and leave Intellisense enabled the issue goes away.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19039 Posts

Posted - Dec 10 2024 :  11:24:27 AM  Show Profile  Reply with Quote
Are you restarting Visual Studio when you make these changes?

Normally VA would not care which platform configuration you were targeting, so I am not sure what is going on here. Off the top of my head, only 2 things should change that effect code parsing when changing the platform configuration.

Firstly your library directories are going to change, but VA should be parsing all "full" set of library directories already. We look for and pick up all the include directories listed.

Secondly different branches in #ifdef blocks will become active. But VA is designed to parse all branches, and be active in all of this code, so we can help you even if the code isn't currently "live" given how your are compiling it.

Am I missing something else that is going to be changing here? The fact that this is the pattern does suggest there is a connection here, I am just not sure why.

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