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
 Suggestions don t show for smart pointers
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

Capmare
New Member

Belgium
4 Posts

Posted - Oct 21 2024 :  10:55:35 AM  Show Profile  Reply with Quote
This is the demo code i am using



#include <iostream>


class MyClass
{
public:
	MyClass();
	~MyClass();
	void getInt();
private:

};

MyClass::MyClass()
{
}

MyClass::~MyClass()
{
}

void MyClass::getInt()
{
}

int main() {


	auto intPtr = std::make_unique<MyClass>();

	intPtr->getInt();
}




These are the suggestion settings that i am using



feline
Whole Tomato Software

United Kingdom
18970 Posts

Posted - Oct 21 2024 :  1:07:19 PM  Show Profile  Reply with Quote
Odd. I am seeing the same effect here, and trying to understand why. So far it seems to be limited to std::make_unique which is something.

Does a valid listbox appear when you press CTRL-SPACE? It does for me.

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

Capmare
New Member

Belgium
4 Posts

Posted - Oct 21 2024 :  1:41:32 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Odd. I am seeing the same effect here, and trying to understand why. So far it seems to be limited to std::make_unique which is something.

Does a valid listbox appear when you press CTRL-SPACE? It does for me.




No, the only time i get a suggestion box is when i activate Default intellisense





But this again only shows the object suggestion and not the pointer functions unless i write -> myself







Apparently the issue persist even when using make_shared



Raw pointer seem to work properly and have no problems when using auto






Not using auto for smart pointers apparently solves the issue for me but this is not a long term solution.




I have also noticed that the same issue happens in unreal engine too when using their own smart pointers.

This is using TObjectPtr




This is using a raw pointer







- Capmare David Nicusor
- MallocStar
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18970 Posts

Posted - Oct 22 2024 :  09:03:02 AM  Show Profile  Reply with Quote
Thank you for the details. This suggests VA isn't working out the return type of "std::make_unique" as you have probably worked out. I am aware we have run into some problems with "std::make_unique" before, but the problem with TObjectPtr is a completely new one for me.

I am looking into the make_unique and make_shared problem now.


For "TObjectPtr", using VS2022, VA 2530 and UE 5.2, I have set up the following very simple test case. In a header file I have the following struct:

struct simpleDateTypeForPointer
{
	short nCharHeight;
	short nCharWeight;
	bool bWearingHat;
	bool bCarryingSword;
};


and in the cpp file I am using it like this:

	TObjectPtr<simpleDateTypeForPointer> localTPtr;
	localTPtr;

typing the dot after "localTPtr", the dot is automatically converted to -> for me, and I automatically get a listbox appear.

I have just tried disabling IDE intellisense via:

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

and restarting VS2022. No change in how VA handles this code. A quite Find in Files for TObjectPtr is showing plenty of usage like this, suggesting this is reasonable code to write. But is this what you are doing in UE? If so, which version of UE are you using?

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

Capmare
New Member

Belgium
4 Posts

Posted - Oct 22 2024 :  10:30:02 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Thank you for the details. This suggests VA isn't working out the return type of "std::make_unique" as you have probably worked out. I am aware we have run into some problems with "std::make_unique" before, but the problem with TObjectPtr is a completely new one for me.

I am looking into the make_unique and make_shared problem now.


For "TObjectPtr", using VS2022, VA 2530 and UE 5.2, I have set up the following very simple test case. In a header file I have the following struct:

struct simpleDateTypeForPointer
{
	short nCharHeight;
	short nCharWeight;
	bool bWearingHat;
	bool bCarryingSword;
};


and in the cpp file I am using it like this:

	TObjectPtr<simpleDateTypeForPointer> localTPtr;
	localTPtr;

typing the dot after "localTPtr", the dot is automatically converted to -> for me, and I automatically get a listbox appear.

I have just tried disabling IDE intellisense via:

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

and restarting VS2022. No change in how VA handles this code. A quite Find in Files for TObjectPtr is showing plenty of usage like this, suggesting this is reasonable code to write. But is this what you are doing in UE? If so, which version of UE are you using?



I have tested the same code snippet as you but it seems to still not work. I m usually using Unreal 5.3, but i tested this in 5.2 to see if there is any change but it still seems to not work.




Intellisense is already disabled for me.
Is there a way to reset visual assist settings?

- Capmare David Nicusor
- MallocStar
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18970 Posts

Posted - Oct 23 2024 :  08:52:07 AM  Show Profile  Reply with Quote
Do you have:

VA Options -> Editor -> Convert dot to -> in C/C++

turned On?

If you use Alt-Shift-G on "localTPtr" and look at "Types of Symbol", what do you see? Testing in UE 5.3, I have 2 sub-items, which are:

TObjectPtr<simpleDateTypeForPointer>
> simpleDateTypeForPointer


and if you instead select "Goto member..." in the menu, you should get a dialog showing the members of TObjectPtr<simpleDateTYpeForPointer> which holds 48 items, including an operator->

How does this compare to what you are seeing?

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

Capmare
New Member

Belgium
4 Posts

Posted - Oct 23 2024 :  10:36:25 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Do you have:

VA Options -> Editor -> Convert dot to -> in C/C++

turned On?

If you use Alt-Shift-G on "localTPtr" and look at "Types of Symbol", what do you see? Testing in UE 5.3, I have 2 sub-items, which are:

TObjectPtr<simpleDateTypeForPointer>
> simpleDateTypeForPointer


and if you instead select "Goto member..." in the menu, you should get a dialog showing the members of TObjectPtr<simpleDateTYpeForPointer> which holds 48 items, including an operator->

How does this compare to what you are seeing?




I have updated the visual assist version to the latest once since i didn t notice there was a new update in the end of last month. It solved the problem with the pointers in unreal engine but the problem still persist with the smart pointers from stl.

- Capmare David Nicusor
- MallocStar
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18970 Posts

Posted - Oct 24 2024 :  07:47:58 AM  Show Profile  Reply with Quote
Thank you for the update, I am glad that something has been fixed, at least.

Since you are now using VA 2535 you may want to turn Off:

VA Options -> Display -> Display VA Navigation Bar:

since this version of VA contains a known bug, where the IDE quick find dialog, CTRL-F, looses focus as you are typing in a string to find. Disabling the VA navigation bar is a reliable work around for now, until we can get a fix released for this problem.


For the stl pointers though, I am wondering if this is somehow a solution specific problem.

If you have the time, can you please try making a new, default C++ solution inside Visual Studio. So nothing involving Unreal Engine. Do you still see the problem there? If this works correctly this would explain why so far I haven't been able to reproduce this here, even with the clear sample code.

zen is the art of being at one with the two'ness
Go to Top of Page
   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