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 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) [Intellisense Error]Visual Studio 2019 Intellisense and namespaces (Read 8574 times)
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #20 - Feb 2nd, 2020 at 11:46pm
Print Post  
I think it's some strange gcc code in the core. If you look in the __vm\project_name.vsarduino.h you will see some intellisense kick start code to try to help vs. The project usually needs to know about the variant because that contains board specific defines etc. In this case I commented out the PinNamesVar and variant.cpp and the issue resolves. The vsarduino.h file is recreated automatically quite often, therefore it can only be changed for a short term test before it is overritten.

#include "arduino.h"
//#include <PinNamesVar.h> 
#include <variant.h> 
//#include <variant.cpp> 
  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #21 - Feb 3rd, 2020 at 9:04am
Print Post  
Hey, thanks Tim, commenting out PinNamesVar.h solves the problem.

I was browsing the STM32Duino source and found that its used in this file:

/PinNames.h" at line 253.

It looks like the include directive in the vsarduino.h file is not required. is there a way to configure what values are stored in the vsarduino.h to maybe disable the #include <PinNamesVar.h> from being written?

https://github.com/stm32duino/Arduino_Core_STM32/blob/ef133955a673837a595f189202...
« Last Edit: Feb 3rd, 2020 at 9:04am by Bambo »  
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #22 - Feb 3rd, 2020 at 9:19am
Print Post  
I'm not sure if this is related but once you comment out the PinNameVar.h then intellisense stops suggesting changes?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #23 - Feb 3rd, 2020 at 12:31pm
Print Post  
I agree that it's up for discussion. How to solve is not so clear. The main issue is that for stm32 depening on which variant we select from the board menu a different pinNames is #included. I think we probably need to exclude the variant and add a copy in a more compatible format.

We can wrap code with an "intellisense only" #define so that the build is not affected. To find an acceptible way of working can you leave the vsarduino.h as is but add a PinNames.h to the local project with code surrounded by #if defined(_VMICRO_INTELLISENSE)?

Code (C++)
Select All
//My PinNames.h
#if defined(_VMICRO_INTELLISENSE)
{
    //code that vs likes
}

 

« Last Edit: Feb 3rd, 2020 at 12:31pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #24 - Feb 3rd, 2020 at 5:42pm
Print Post  
Tim@Visual Micro wrote on Feb 3rd, 2020 at 12:31pm:
I agree that it's up for discussion. How to solve is not so clear. The main issue is that for stm32 depening on which variant we select from the board menu a different pinNames is #included. I think we probably need to exclude the variant and add a copy in a more compatible format.

We can wrap code with an "intellisense only" #define so that the build is not affected. To find an acceptible way of working can you leave the vsarduino.h as is but add a PinNames.h to the local project with code surrounded by #if defined(_VMICRO_INTELLISENSE)?

Code (C++)
Select All
//My PinNames.h
#if defined(_VMICRO_INTELLISENSE)
{
    //code that vs likes
}

 



ok i will try to see if this works, for now i've just removed the contents of #include <PinNamesVar.h> and placed them in the PinNames.h file. i don't think the varients.h have any effect, it's just when it includes <PinNamesVar.h> its including a part of a list of enums, which is ment to be wrapped in enums like this:

PinNamesVar.h
Quote:
#ifdef def1 

enumEntry = 1,

#endif


PinNames.h
Quote:
enum stuff
{
#include "PinNamesVar.h"
}


So when the PinNamesVar.h is included in vsarduino.h it breaks the code
« Last Edit: Feb 3rd, 2020 at 5:43pm by Bambo »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #25 - Feb 5th, 2020 at 2:54pm
Print Post  
Please install version 2001.3.5 to see if that resolves all issues. 

There might still be 7-10 intellisense errors (relating to the core) in the Error List window if the window is set to show "Intellisense + Build". You can switch the error list to "Current Project" or "Open Documents" to hide intellisense errors that are outside of your own code.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES


After applying the update you should not need to add any intellisense workarounds.
« Last Edit: Feb 5th, 2020 at 2:55pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: [Intellisense Error]Visual Studio 2019 Intellisense and namespaces
Reply #26 - Feb 6th, 2020 at 1:13pm
Print Post  
That worked!

Thanks Tim.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint