T O P I C R E V I E W |
CliffyP |
Posted - Apr 02 2016 : 2:54:01 PM Ive been using VA for a while now and here are some of the oddities that consistently bug me (vs 2013):
1. Find References does not appear to be fully contextually typed, and often gives incomplete results. For example if I do find references on a method in a specific class then it will return results on methods of the same name from other classes as well, which to me is undesired behavior as its little more than grep on that name. While other times I will do find references on a method, and it does not return all references, as I can do a grep and see more references that it missed (this is with the display references from all projects option at true).
2. VA breaks down on templated arrays (such as in UE3/UE4), where the . to -> and visa versa converter feature does not work on them, and worse the suggestion lists fails to work on them.
For Example
TArray<MyThing> MyThingArray;
VA does not know how to handle the potential result of indexing like this.
MyThingArray(0) ?????
there it cannot tell if it should be a . or a ->, and once the correct expression is supplied, it does not produce a suggestion list.
3. the hashtags window badly needs multi-select functionality, and the option to hide all unselected. As in a project with a ton of the hashtags, the hastags window updates itself constantly and makes editing sluggish if there is too many tags unhidden in it.
|
20 L A T E S T R E P L I E S (Newest First) |
sean |
Posted - Feb 21 2018 : 5:47:23 PM case=109251 was opened for sluggish VA Hashtags toolwindow. case=109251 is fixed in build 2258 |
feline |
Posted - Apr 27 2016 : 1:25:46 PM I am not really that surprised, this happens now and then. As soon as we start studying a problem closely it disappears, without us ever figuring out the cause.
For settings being saved, if you work with more than one instance of the IDE open at the same time, and change settings in one instance but not the other, you are opening the way for confusion, since which set of settings is changed?
Hopefully this will stay fixed, but if not, we will keep on looking and trying to figure out what happened here. |
CliffyP |
Posted - Apr 27 2016 : 12:27:59 PM well your not gonna believe this, but the problem is no longer happening.
I had made a bunch of changes to the VS options, and made sure I was logged in so that it would save yesterday.
and then today I see that the member list suggestions for the TArray () operator is working correctly now.
My guess is that the default VS intellisense was interfering with it, cause I kept thinking I had turned it off, but when I go to check the options it was magically on even though I know I turned it off. VS seems to be bad about properly saving my changes to the options.
Anyways, blame MS and call it a day. |
feline |
Posted - Apr 25 2016 : 1:28:44 PM What happens if you make a new instance of the type inside the TArray? So for the array:
TArray<typeNotBeingListed> foo;
// what happens here:
typeNotBeingListed fooTestDirect;
fooTestDirect.
My TArray tests all work, but I am using a different version of the class. So we need to make sure its not a problem with the type inside the TArray. |
CliffyP |
Posted - Apr 25 2016 : 11:14:18 AM Yes it shows up correctly in VA View, yes the templated type is apparent in the hover tooltip, and yes I see the members listed in va view and in goto member, including the operator(). |
feline |
Posted - Apr 25 2016 : 10:45:11 AM Well, at least we now know why I am not able to reproduce the problems here. Some progress, but not entirely helpful progress.
Let's go back to basics. If you show VA View, then place keyboard focus back into the editor, and now hover the mouse over one of your variables of type TArray what class information is displayed? Are you getting the class TArray? Does it have the correct template type? Are the expected members being listed?
If VA does not know the variable is of type TArray then we need to study why. |
CliffyP |
Posted - Apr 24 2016 : 11:00:10 AM Ive tried it in ue4 myself and concur that it is working as I would expect there, so it appears the issue is exclusive to ue3's TArray. As far as I can tell it is very similar to ue4's version aside from using () instead of []. |
feline |
Posted - Apr 15 2016 : 2:42:07 PM Can someone tell me what to use as a proper test for TArray, or one of the other problem template classes in Unreal Engine? Assume I know nothing at all about Unreal Engine, since I don't.
I have registered, and downloaded the zip file giving me the Unreal Engine 4 trunk source code. After running a couple of batch files in the base directory, and waiting quite a while, I have the file:
C:\UnrealEngine-release\UE4.sln
When opening this in VS2015, with VA 2094, VA is reporting 16,836 files. At random, I picked the file "AbilitySystemComponent.cpp", and above the first function and after "#define LOG_RENDER_STATE 0", I added the test code:
struct felineSimpeStruct
{
int nMemberOne;
int nMemberTwo;
int nMemberThree;
};
void testingArrayHandling()
{
TArray<felineSimpeStruct> arrayOne;
// type dot after ] and the correct struct members are listed
// with listbox content from both VA and default intellisense
arrayOne[0];
}
Since my tests are perhaps wrong, I did a find in files for "TArray" in a cpp file, and again picking a result at random, I have looked at the file "PaperTerrainComponent.cpp"
In my version of the file, inside the class "FPaperTerrainSceneProxy" line 65 has the code:
TArray<FPaperTerrainSpriteGeometry> DrawingData;
Dropping down to line 75, inside the class constructor, we have:
DrawingData = InDrawingData;
so I added the line:
DrawingData[0].
and I am getting the correct members listed in the listbox.
These are simple tests, but I need to start somewhere. |
CliffyP |
Posted - Apr 13 2016 : 3:33:59 PM Your TArray use example setup does not compile.
"TArray<*simpleStruct> arrayPointer;"
I assume you intended this to be a pointer type...
To test VA functionality on TArray, look for existing use cases in the UE4 codebase and test those to verify if it works or not. I'll try it myself tonight, but I do know Ive never seen it work properly in UE3.
Regarding Find References:
"you are doing the find on the call to the base class function"
No, I was doing the find on the derived class function.
"If a find here is expected to show the derived class references, then why not this direct call"
It is not a direct call, it is not a reference to what I asked to find references on.
Look at my example and what I said again, you seem to have assumed I did find references from the base class. The context of what Im calling find references on is very important.
|
yatagarasu |
Posted - Apr 12 2016 : 11:13:44 PM Yes, I can confirm that I am experiencing the same problems with Unreal Engine too. Not only TArray does not work, but also Cast<> and many other template functions. Unreal Engine code is very delusive, with same objects declared in different parts, so it can be very complex to parse it. UE uses a lot of `class SomeName` declarations and minimizes crossfile dependencies, a lot of macros and platform dependent compilation. feline, if you can, would you please download UE from epic games and test VA on it's source. UE is free to download, only a registration required. |
feline |
Posted - Apr 11 2016 : 9:16:14 PM Do you have a copy of the Unreal Engine 4 array.h file on hand? I have made a new C++ console app, added the "array.h" file to it, and using the test code:
#include "Array.h"
struct simpleStruct
{
int nMemberOne;
int nMemberTwo;
int nMemberThree;
};
void testTArrayHandling()
{
TArray<simpleStruct> arrayDirect;
TArray<*simpleStruct> arrayPointer;
// dot stays as dot, and correct members are listed for both
arrayDirect[0];
arrayPointer[0];
}
dot not being converted to arrow is a known problem, now I know what I am testing:
case=9513
We are hoping to get to this relatively soon, but I don't currently have an estimate for when. It's still possible to confuse VA with templates.
But what is more interesting is that I am getting the correct members listed, in both cases. I have tried with listboxes from VA and from default intellisense, and I always get the correct items listed. So I am wondering what the difference is between my test code and what you are doing.
Find References, yes, you are doing the find on the call to the base class function, but you have told VA that you want to see where this function is inherited and overridden. So if you were calling the function from a member function of the base class, what do you expect Find References to list?
If a find here is expected to show the derived class references, then why not this direct call?
I see that it looks odd, but thinking about it, it makes sense to me, if you have this turned on. |
CliffyP |
Posted - Apr 07 2016 : 10:29:53 PM "What do you have:
VA Options -> Enhanced Listboxes -> Source of C/C++ content: Visual Assist OR Default Intellisense
set to?"
Visual Assist |
CliffyP |
Posted - Apr 07 2016 : 10:19:08 PM "I am not seeing an operator() in this class."
oh, I thought they were the same, looks like in UE4 it is the operator[] instead of operator() but other than that they do the same thing.
Yes find references returns that call for me as well in your example, but that is a recursing call, not a regular call, although when I tried a regular call with that example setup that also worked properly, so the cause of the issue I was seeing must be more subtle. However we can see the other issue if ya change the example to be like this:
in an example.h
class testFelineBaseClass
{
virtual void DoingThings();
};
class testFelineDerivedClass : public testFelineBaseClass
{
virtual void DoingThings();
};
class testFelineDerivedClass2 : public testFelineBaseClass
{
virtual void DoingThings();
};
in an example.cpp
void testFelineBaseClass::DoingThings() { };
void testFelineDerivedClass::DoingThings()
{
testFelineBaseClass::DoingThings();
}
void testFelineDerivedClass2::DoingThings()
{
testFelineBaseClass::DoingThings();
}
So for example to illustrate the problem, do a find references (with inherited and overriden set to true) on testFelineDerivedClass::DoingThings() in the header file, and then you will see that it returns as a reference: testFelineBaseClass::DoingThings() in the testFelineDerivedClass2::DoingThings() implementation.
considering the context of the call I don't see how it logically could be considered a reference. |
feline |
Posted - Apr 07 2016 : 6:16:37 PM For Find References, can you please try the following code. As the comment indicates, I am seeing 3 references for both functions, and going to the results, the results are for the base or derived class. Are you ever seeing call sites when you do a Find References in this situation?
class testFelineBaseClass
{
virtual void DoingThings();
};
void testFelineBaseClass::DoingThings() { }
class testFelineDerivedClass : public testFelineBaseClass
{
virtual void DoingThings() override;
};
void testFelineDerivedClass::DoingThings()
{
// find ref on this function call finds 3 correct references
testFelineBaseClass::DoingThings();
// find ref on this function call finds 3 correct references
// recursive calling
DoingThings();
}
I am not sure why I missed TArray the first time, thank you for the path. I am not seeing an operator() in this class. If you look in the alt-m list in "Array.h", and filter on "operator(", are you seeing an operator() for TArray? In my version of Array.h I am only seeing "operator()" for the class "TReversePredicateWrapper" |
CliffyP |
Posted - Apr 06 2016 : 11:17:58 PM ""Display inherited and overridden references" turned On or Off?"
Its on, tried it at off, but it only shows the declaration and the definition, not the call sites.
Ive tried find references some more and I am thinking the problem I described is due to this sort of setup:
(where this is a virtual function implementation in a derived class)
void MyDerivedClass::DoSomething() { //do derived class stuff //.... //then call parent's method (super being a pointer to the parent class) Super::DoSomething(); }
" VA's Add Include "
I see now, yah the problem I described was exclusive to VA, the code compiles just fine.
"Do you know where TArray is declared?"
Seems a strange question to ask, if you have the ue4 source now, why not just use visual assist's GoTo Related... -> Declaration on one of the many instances of its use in the codebase?
Looks like its here: \UnrealEngine\Engine\Source\Runtime\Core\Public\Containers\Array.h |
feline |
Posted - Apr 06 2016 : 3:16:01 PM For ease, I have just tried making a very simple template class:
template <typename T>
class testTemplateBrackets
{
T operator()(int nArrayMember)
{
return null;
}
};
when I use this test template, dot is converted to -> correctly, as expected, and I get the correct member listbox. Testing both VS2013 and VS2015 with VA 2094. So it looks like I need to test with TArray. |
feline |
Posted - Apr 06 2016 : 2:25:31 PM Do you know where TArray is declared? I have downloaded the source code from github, and digging, I cannot find the class declaration, only documentation files.
I am guessing that TArray is declared in "KismetArrayLibrary.generated.h", but I don't have this file.
Could you post the function declaration for (), I am assuming they are just overriding the operator() function in the template class. |
feline |
Posted - Apr 06 2016 : 10:48:17 AM Point 1, if you right click in the Find References Results list, do you have "Display inherited and overridden references" turned On or Off? I am guessing you have this turned On. Does turning this Off give you the results list you are looking for and expecting?
This won't help with missing results, but hopefully it is a step in the right direction.
Point 2, apologies, I was not clear. I was using VA's Add Include refactoring command:
http://support.wholetomato.com/default.asp?W177
to search for a header for the class "TArray", since I don't recognise the class name. I recognise Unreal Engine, but did not realise this is what you were talking about when you said UE3 / UE4. Our users use all sorts of tools and libraries, I recognise some of them, but only some of them. The rest I have to look up as and when required.
I will look for a download for Unreal Engine 4 and see if I can reproduce the problems with TArray.
Point 3, is using the registry key to set the minimum length for hashtags an option?
http://support.wholetomato.com/default.asp?W578
this is something that is available now, so worth suggesting in case it helps. |
CliffyP |
Posted - Apr 04 2016 : 1:59:15 PM 1. The problem with returning more results than it should appears to happen on virtual methods. So for example if I do find references on a virtual method from the context of a derived class, it will return results on that method from other derived classes (of the same parent, but otherwise unrelated to the one I triggered the find references from) as well. Whereas I would expect it to only return the results for the class I called it from, its parent/s and the call sites.
2. "should I know the class TArray? VA is not offering add include" What is add include? You can see what a TArray type is like in the open source Unreal Engine 4 project. Epic recommends using VA with UE3/UE4 so I assumed it was well known by you guys. In my case I am using UE3 which is not open source, but they both have this class which is not much different between them.
"VA Options -> Editor -> Convert dot to -> if operator -> is overloaded is designed to help here, and may need to be turned on for this to work correctly."
This class does not overload the -> operator.
3. Right, I am aware of that, and it doesn't, hence why I asked for what I did. |
feline |
Posted - Apr 03 2016 : 5:23:16 PM Point 1, this is not what is supposed to happen. Find References is designed to work out the correct class, to find all references, but only for the correct class.
It sounds like you are often seeing Find References producing the wrong results. If so, would you be able to post a code sample that shows this problem in action? If we can work out what is triggering the problem, we can try to do something about it. It is possible there is more than one bug at work here though, if you are seeing this a lot.
Point 2, should I know the class TArray? VA is not offering add include on this in VS2015, and it's not a type I recognize off the top of my head.
The option:
VA Options -> Editor -> Convert dot to -> if operator -> is overloaded
is designed to help here, and may need to be turned on for this to work correctly.
What do you have:
VA Options -> Enhanced Listboxes -> Source of C/C++ content: Visual Assist OR Default Intellisense
set to? This defaults to Default Intellisense in VS2015. Does changing this setting have any effect?
Point 3, if you right click, is using the hide directory or hide project options of any use here? This should help you to thin out the list, but I am not sure if it would make much difference to you. If you right |
|
|