Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Intellisense problem with function overloading (Read 1771 times)
Bjorn Moren
Newbies
*
Offline


Posts: 2
Location: Sweden
Joined: Apr 15th, 2019
Intellisense problem with function overloading
Apr 15th, 2019 at 7:31am
Print Post  
Hi Visual Micro community! First I want to compliment the makers of Visual Micro. It makes Arduino development so much easier. My only wish is for a better debugger, where I can hover over variables and see their values in real time as I single step through the code.

However, intellisense seems to be a persistent problem, and it can get a bit annoying. Through trial and error, I have learned that it can take a while for the intellisense to catch up, a simple recompile won't always do the trick. Take a one minute break, come back, and there might not be a problem anymore. Still, it is frustrating, because a code that compiles fine shouldn't have any intellisense errors.

Here is a minor intellisense problem that won't go away though. It looks like intellisense can't pick the correct overloaded function when they are listed in a certain order. See code below, and also the attached screen shot.

Code (C++)
Select All
class TestClass
{
public:
	void add(const __FlashStringHelper *str) { };				// This won't work
	void add(const char *str) { };
	void add(uint8_t n) { };
	void add(int8_t n) { };
	void add(int32_t n) { };

	//void add(uint8_t n) { };									// But this will
	//void add(int8_t n) { };
	//void add(int32_t n) { };
	//void add(const __FlashStringHelper *str) { };
	//void add(const char *str) { };

	inline void  operator << (const __FlashStringHelper *str) { return add(str); }       // Intellisense error here
	inline void  operator << (const char *str) { return add(str); }       // Intellisense error here
	inline void  operator << (int32_t value) { return add(value); }
	inline void  operator << (uint8_t value) { return add(value); }
	inline void  operator << (int8_t value) { return add(value); }
};
 




« Last Edit: Apr 15th, 2019 at 2:51pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bjorn Moren
Newbies
*
Offline


Posts: 2
Location: Sweden
Joined: Apr 15th, 2019
Re: Intellisense problem with function overloading
Reply #1 - Apr 15th, 2019 at 7:40am
Print Post  
Forgot to mention that I'm using Visual Micro 1903.24.2 on VS Community 2017. Compiling for Arduino Uno.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense problem with function overloading
Reply #2 - Apr 15th, 2019 at 3:23pm
Print Post  
Hi,

Thanks for the post and useful info. 

I suspect the intellisense issue is because the visual studio intellisense engine is not perfect with GCC. We use visual studio for intellisense but not for build. We will shortly move intellisense to using clang which should be better. 

It might not help in this case but it is possible to create intellisense workarounds. This involves redefining types within a preprocessor condition that states intellisense only. It's not a great solution.

As for debugging we have an update for visual micro due for release that supports GDB. The only issue will be for an Uno GDB doesn't always work so well. The update should be available in the forum releases section over the next few days and then in the gallery in a few weeks.

The standard visual micro debugger uses serial which it has to inject into hidden temp copies of the code just prior to compile. Therefore it is difficult to give the live view you are looking for on any variable at any time but gdb will do that and in the standard visual studio debugger windows. 

  
Back to top
WWW  
IP Logged
 
Bjorn Moren
Newbies
*
Offline


Posts: 2
Location: Sweden
Joined: Apr 15th, 2019
Re: Intellisense problem with function overloading
Reply #3 - Apr 15th, 2019 at 4:39pm
Print Post  
Thanks Tim!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint