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 Errors in Visual Studio (ESP32 toolchain) (Read 6248 times)
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Intellisense Errors in Visual Studio (ESP32 toolchain)
Feb 9th, 2020 at 7:20pm
Print Post  
I am having a couple intellisense issues in Visual Studio while using vMicro:

1. Large number of intellisense errors for toolchain code (esp32 1.0.4).  By large I mean over 300.
2. ArduinoJson classes and functions not showing in intellisense when typing and showing error after entering.
3. Intellisense does not recognize a version of ESP_LOGI that includes a format macro.

The code compiles just fine.

I use 2 machines and these issues appear on one machine and not the other.  On the second machine I was able to see similar behavior as soon as I switched to Release from Debug but it resolved when I built the code.  The same isn't true on the first machine.

In investigating I've noticed that ArduinoJson doesn't get a folder created in the debug folder when I build.   I don't know if this is related but it don't understand why it's the only library I added that doesn't so I'm adding the detail.

Attached are the build properties and a list of the errors.
« Last Edit: Feb 9th, 2020 at 7:27pm by David Newberry »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #1 - Feb 9th, 2020 at 7:41pm
Print Post  
For comparision, here are the files from the 2nd machine that doesn't have the same issues.

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #2 - Feb 9th, 2020 at 8:27pm
Print Post  
Thanks for the info. The visual micro build outputs include only the properties but not a build. Please ensure that both properties mentioned above which includes "verbose" are enabled then click build. Then submit the output for the build. This is epecially required on the machine that shows many intellisense errors.

If the build fails we still need to see the output.

Thanks.
  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #3 - Feb 9th, 2020 at 8:40pm
Print Post  
I apologize.  I misunderstood what you needed.  Attached
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #4 - Feb 9th, 2020 at 9:02pm
Print Post  
No probs, thanks it is useful to see it all.

Initially i see a main problem reported in the webservertask.ino which the intellisense says is missing a bracket ). However that might be the result of some other issue.

If you don't mind zipping and emailing your project from the pc with the most intellisense errors that would be useful thanks.
  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #5 - Feb 9th, 2020 at 9:17pm
Print Post  
That's because of issue number 3 above.  As I said, this code compiles and uploads just fine.  For instance, I can use something like this:

ESP_LOGI( TAG, "Starting upload." );

And Intellisense recognizes it.  If I use another version that includes a format string like:

ESP_LOGI( TAG, "Starting upload. filename = %s\n", filename.c_str() );

Intellisense says I am missing a bracket.  This isn't true as this is a functional version of the logging function.  It's just a printf runtime macro.

I have emailed my project.
« Last Edit: Feb 9th, 2020 at 9:18pm by David Newberry »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #6 - Feb 9th, 2020 at 9:37pm
Print Post  
Thanks I will take a look in a while. Hopefully we are not hitting an issue where Visual Studio VC++ is unable to interpret gcc commands. The intellisense is unrelated to the build, we try to feed vs with a few gcc defines and the correct paths to core and libs then let it do whatever it wants for intellisense.

In future releases we hope to make use of new vs functionality that allows us to use CLang instead of VC++ for intellisense.

Anyway I will report back shortly.

It might be useful to see the .vcxproj from the version that doesn't have the intellisense issue.

  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #7 - Feb 9th, 2020 at 9:39pm
Print Post  
If necessary, let me know and I'll send you that version but they are identical because they are both the same version downloaded from source control.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #8 - Feb 9th, 2020 at 9:45pm
Print Post  
It's possible the difference is in the C++ project settings which is why I asked for the .vcxproj files from the working one. There are a few settings that can tweak how intellisense responds. It might also be useful to see the full build output from the other machine 



  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #9 - Feb 9th, 2020 at 9:46pm
Print Post  
Here is the build output.  I couldn't find any difference other than directory locations.
« Last Edit: Feb 9th, 2020 at 9:50pm by David Newberry »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #10 - Feb 10th, 2020 at 12:09am
Print Post  
I should clarify so that we don't chase the wrong thing, this happens on this machine even with example code.  It's not just this project.  I completely reset windows on the machine last night and it didn't change anything.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #11 - Feb 10th, 2020 at 1:09am
Print Post  
Let's ignore the machine that appears to work. There should be approx 15 errors showing when things are working properly. When things are working properly the errors won't show if you set the error list to "Open Documents" 

Please add a patch file called vs-intellisense-fix.h to the "__vm" folder below your project. Add the following to the file. 

Code
Select All
#define ESP_LOGI(tag, ...) 



You do not need to reference the file from your code, just click build after adding it. That should resolve the printf issues and represents a change for intellisense in the next release of visual micro.







  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #12 - Feb 10th, 2020 at 3:57am
Print Post  
Thanks.  That got rid of the ESP_LOGI issue which has been annoying.  Now if we can just figure out the other 312 errors and why ArduinoJson classes and functions aren't being recognized.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #13 - Feb 10th, 2020 at 12:01pm
Print Post  
That was for the "unaffected project" which i guess was okay, did you send the source for the one that has an issue?
  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #14 - Feb 10th, 2020 at 3:30pm
Print Post  
I did.  I just resent it.
  
Back to top
 
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #15 - Feb 10th, 2020 at 3:33pm
Print Post  
I noticed something interesting yesterday.  If I open the files for ArduinoJson from the References section of the Solution Explorer that contain the classes and functions that aren't showing up, I can intermittently get the errors for them to go away.  If I close the files they come back.  It's also not consistent and very messy.  I even tried opening every file from references and that only created more errors.  It's like it's not reading the files correctly.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #16 - Feb 10th, 2020 at 4:08pm
Print Post  
I am not getting any emails from that other machine.

The ArduinoJson has always pushed the limits of vs. It's a clever library. The Vs error window can behave as you have said I think that's why the added the options to filter out intellisense or limit it to open files (which helps). None of the options are perfect but we should be able to improve it somewhat.

  
Back to top
IP Logged
 
David Newberry
Junior Member
**
Offline


Posts: 17
Joined: Feb 9th, 2020
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #17 - Feb 10th, 2020 at 5:04pm
Print Post  
I just sent it again to sales@visualmicro.com.

Regardless, it's the same code.  It's also not just ArduinoJson that is the issue.  There are 312 errors showing up and only a few are from ArduinoJson.  I can filter to open documents but that doesn't really solve the issue.

You likely won't see the same errors that I'm seeing since I don't see them on a different machine.  This is why I completely reinstalled windows and visual studio.  It's didn't solve the issue.  I also exported all visual studio settings from the working machine to the affected machine and that didn't solve it either.  For some reason, Intellisense is not scanning source files properly.  The issue is most clear with ArduinoJson but it is happening with other built in libraries as well.  As stated, I can open a file that is listing errors in visual studio and then those errors change or disappear.  If I close the file, they revert back.  I can't make sense of that behavior at all.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #18 - Feb 10th, 2020 at 5:49pm
Print Post  
Not arrived please try sending to visualmicro@outlook.com to see if that works

Try closing the solution, deleting the ".vs" folder then re-opening.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense Errors in Visual Studio (ESP32 toolchain)
Reply #19 - Feb 10th, 2020 at 9:50pm
Print Post  
Thanks for sending. I think I have replicated the issue. We will start showing library versions in the verbose output next release.

If you open the vMicro Platform Explorer and click the Library Manager tab then expand the ArduinoJson library I suspect your machine with a lot of errors is on a much more recent version of the library.  I had an older one installed with my initial tests.

We will see if we can see why the library causes so much chaos, it does make a lot if use of .tcc files which doesn't help vs.


With the latest ArduinoJson I found that even this basic sketch produced samed errors as you have seen:-

Code (C++)
Select All
#include <ArduinoJson.hpp>
#include <ArduinoJson.h>

void setup() {
   
}

void loop() {
   
}
 



I think the only way to work is to limit the Error List to "open documents" or "build only"

« Last Edit: Feb 10th, 2020 at 10:17pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint