Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Intellisense problem with function overloading (Read 281 times)
Bjorn Moren
Newbies
*
Offline



Posts: 2
Sweden
Intellisense problem with function overloading
Apr 15th, 2019 at 8:31am
 
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++):
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); }
};
 




Back to top
« Last Edit: Apr 15th, 2019 at 3:51pm by Visual Micro »  

Untitled-1_002.jpg (154 KB | 3 )
Untitled-1_002.jpg
 
IP Logged
 
Bjorn Moren
Newbies
*
Offline



Posts: 2
Sweden
Re: Intellisense problem with function overloading
Reply #1 - Apr 15th, 2019 at 8:40am
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10155
United Kingdom
Re: Intellisense problem with function overloading
Reply #2 - Apr 15th, 2019 at 4:23pm
 
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
Sweden
Re: Intellisense problem with function overloading
Reply #3 - Apr 15th, 2019 at 5:39pm
 
Thanks Tim!
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print