Author |
Topic |
|
hophop
Junior Member
France
10 Posts |
Posted - Jan 02 2018 : 1:31:30 PM
|
Hi, I have an issue where if I make a function in a derived class with the same name as a member variable in the base class, 2 completion list shows up, and list items are mixed up. functions shows up as variable, etc..
Here is a code sample
class A
{
public:
int x;
int y;
};
class B
: public A
{
public:
inline int& x()
{
return A::x;
}
inline int& y()
{
return A::y;
}
};
int main()
{
B b;
int x = b.x();
}
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 03 2018 : 05:14:43 AM
|
Which IDE and version of VA are you using?
What do you have:
VA Options -> Enhanced Listboxes -> Source of C/C++ content: Visual Assist OR Default Intellisense
set to?
I am not seeing the problem here, but to help me make sense of what you are doing, I have renamed the symbols, so I can more easily follow what is happening. This is the renamed code that I am testing:
class CBaseReplacedMemberNames
{
public:
int variableOrFunctionOne;
int variableOrFunctionTwo;
};
class CChildReplacedMemberNames
: public CBaseReplacedMemberNames
{
public:
inline int& variableOrFunctionOne()
{
return CBaseReplacedMemberNames::variableOrFunctionOne;
}
inline int& variableOrFunctionTwo()
{
return CBaseReplacedMemberNames::variableOrFunctionTwo;
}
};
void testingClassesOverlappingNames()
{
CChildReplacedMemberNames fooChild;
// type dot at the end of this line, one listbox appears
// with 2 items listed, the items have different names
int nLocalVar = fooChild;
} |
zen is the art of being at one with the two'ness |
|
|
hophop
Junior Member
France
10 Posts |
Posted - Jan 04 2018 : 03:20:05 AM
|
Hello feline,
thanks for your answer.
quote: Originally posted by feline
Which IDE and version of VA are you using?
What do you have:
VA Options -> Enhanced Listboxes -> Source of C/C++ content: Visual Assist OR Default Intellisense
set to?
VS 2017 15.5.2 VA_X.dll file version 10.9.2248.0 built 2017.12.16
Okay so, source of enhanced listboxe was set to default intellisense. When this is set to visual assist, the only issue is the icons of the items are wrong. But there is no more 2 listbox.
Your code recreate the issue as well, but the items in the list are corrects.
Here is a screenshot to illustrate it. With default intellisense as enhanced listbox content source.
Right is my original code. Left is your code. (The code I posted in the first post was a simplified version)
|
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 04 2018 : 2:38:03 PM
|
Thank you for the screen shots, that's very clear, but also something I am really not used to seeing or coming across.
Can you please export your VA and IDE settings and send them to me:
VA Options -> Performance -> Export Settings IDE tools menu -> Import and Export Settings -> Export selected environment settings
Please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up.
I can then import them here and see if I can reproduce the problem, in case your settings are part of the trigger here. |
zen is the art of being at one with the two'ness |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 06 2018 : 08:58:21 AM
|
I have the settings, many thanks for these:
case=113553
Are you seeing this on demand, every time you trigger a listbox?
Can you reproduce this in a new, default solution?
There is something odd happening with your settings, testing VS2017 15.5.2 under Windows 7, with VA 2248, when I first load my test solution, and trigger this problem listbox, I get two listboxes, but one after another. One flashes up for a second or so, then disappears to be replaced by a second listbox. But this only happens the first time I trigger a listbox after loading the IDE. To reproduce this two listbox behaviour I have to close and reload VS2017.
So I am a step towards reproducing your problem, but it looks like there is an extra factor, beyond simply the IDE and VA settings. |
zen is the art of being at one with the two'ness |
|
|
hophop
Junior Member
France
10 Posts |
Posted - Jan 07 2018 : 05:33:01 AM
|
Hey,
Yes, it happens every time I trigger a listbox. Yes, happens in a new solution as well.
I get an exception notification the first time I trigger a listbox. Didnt realize the two were probably related. I get no exception when I set VA as enhanced listbox source.
Here is the part of ActivityLog.xml about the error. Also, I did a VA update before the whole thing. But I wrote the code after the update, and the issue only appears with this specific code so, I can't be sure if the update has anything to do with it.
<entry> <record>923</record> <time>2018/01/07 10:23:21.961</time> <type>Error</type> <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source> <description>A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider". ---> System.NullReferenceException: Object reference not set to an instance of an object.#x000D;#x000A; at ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider..ctor(ClassificationTypeMap typeMap)#x000D;#x000A; --- End of inner exception stack trace ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()</description> </entry> <entry> <record>924</record> <time>2018/01/07 10:23:21.967</time> <type>Error</type> <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source> <description>A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: Import "ac.a" could not be satisfied. ---> Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider". ---> System.NullReferenceException: Object reference not set to an instance of an object.#x000D;#x000A; at ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider..ctor(ClassificationTypeMap typeMap)#x000D;#x000A; --- End of inner exception stack trace ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()#x000D;#x000A;--- End of stack trace from previous location where exception was thrown ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()#x000D;#x000A; --- End of inner exception stack trace ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.SatisfyImmediateImports()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()</description> </entry> <entry> <record>925</record> <time>2018/01/07 10:23:23.375</time> <type>Error</type> <source>Editor or Editor Extension</source> <description>Microsoft.VisualStudio.Composition.CompositionFailedException: Import "ac.a" could not be satisfied. ---> Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider". ---> System.NullReferenceException: Object reference not set to an instance of an object.#x000D;#x000A; at ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider..ctor(ClassificationTypeMap typeMap)#x000D;#x000A; --- End of inner exception stack trace ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()#x000D;#x000A;--- End of stack trace from previous location where exception was thrown ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()#x000D;#x000A;--- End of stack trace from previous location where exception was thrown ---#x000D;#x000A; at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)#x000D;#x000A;--- End of stack trace from previous location where exception was thrown ---#x000D;#x000A; at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)#x000D;#x000A; --- End of inner exception stack trace ---#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.SatisfyImmediateImports()#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)#x000D;#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()#x000D;#x000A; at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()#x000D;#x000A; at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0()#x000D;#x000A; at System.Lazy`1.CreateValue()#x000D;#x000A; at System.Lazy`1.LazyInitValue()#x000D;#x000A; at System.Lazy`1.get_Value()#x000D;#x000A; at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)</description> </entry>
*edited by feline so it will word wrap* |
Edited by - feline on Jan 08 2018 06:05:15 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 08 2018 : 06:03:56 AM
|
The exception may not be related, but its certainly very interesting. As a first step, can you please disable VA in the:
IDE tools menu -> Extensions and Updates...
dialog. This will require an IDE restart to take effect. Can you then please enable VA in the same dialog, which will require another restart. Does this make any difference to the exception on first triggering the listbox? Doing this can fix an exception that happens on first loading the solution, so it may help here.
I am not seeing any sign of an exception when I test the code with your settings, so the settings are not the full trigger. |
zen is the art of being at one with the two'ness |
|
|
hophop
Junior Member
France
10 Posts |
Posted - Jan 08 2018 : 06:51:16 AM
|
Disabling/enabling VA didnt solve it. But doing so for another extension did. Doesn't seem to happen again.
Let just say my install was corrupted somehow... sorry for wasting your time. |
Edited by - hophop on Jan 08 2018 07:11:46 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 08 2018 : 07:51:36 AM
|
Really not a problem, it is what we are here for :) And since the problem did involve a VA listbox appearing, we were the logical place to start asking questions about this.
If you don't mind me asking, what was the other extension? Was it a widely available one, or an in house extension? If a widely available extension can have this effect when corrupt, it would be useful to know for future reference, since its one more thing to suggest people try when having a problem. |
zen is the art of being at one with the two'ness |
|
|
hophop
Junior Member
France
10 Posts |
Posted - Jan 09 2018 : 03:39:35 AM
|
Sure, it's hlsl tools for visual studio.
And... the bug is showing up again. Tried to reinstall both VA and hlsl tools, and the bug is still there. So maybe there is a real issue afterall.
edit: this happens with every class, not just the code I posted above. I feel dumb now. For my defense, that bug is acting weird.
Feline may you please confirm the bug is happening on your side? |
Edited by - hophop on Jan 09 2018 04:12:45 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 11 2018 : 3:50:54 PM
|
We are getting somewhere! Now that I have installed hlsl tools in VS2017, I am seeing both the exception, and a double listbox.
Disable hlsl tools in the IDE extensions and updates dialog, restart the machine, and both the exception and the double listbox goes away.
I am not seeing any obvious signs of settings for hlsl tools, am I just looking in the wrong places? Or does this extension really not have any settings in the IDE UI?
I know next to nothing about HLSL, but I thought these shader files used a different file extension, even though they had C like syntax. Is this correct? I recall the occasional request about VA supporting them, which is where I got this idea from.
If this is true, I am wondering if there are settings that will tell hlsl tools to leave .cpp and .h files alone, since these don't actually contain shader code. |
zen is the art of being at one with the two'ness |
|
|
hophop
Junior Member
France
10 Posts |
Posted - Jan 12 2018 : 03:52:12 AM
|
Options are in Tools > Options > Text Editor > HLSL
Shader files do use a different file extension (.hlsl usually). Thats why I didnt think about it in the first place. There is no reason for it to interfere with cpp files.
The exception is about a MEF import so Im guessing this is more related to some MEF intellisense component than it is to cpp files. |
Edited by - hophop on Jan 12 2018 03:52:50 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 12 2018 : 4:39:02 PM
|
I missed those settings, I didn't dig that deeply into that node in the IDE options dialog, but it makes sense when you know to look there. Sadly I am not seeing any settings to control which file extensions this extension cares about.
I have put in a bug report for the conflict:
case=113753
I have found a work around, which will hopefully work well for you. Set:
IDE tools menu -> Options -> Text Editor -> C/C++ -> Advanced -> Disable Database = True
this stops both the double listbox and the exception for me. This only gives you VA listboxes, from VA intellisense, but hopefully this will be accurate enough and complete enough. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|