VS Arduino
Visual Micro >> Visual Studio 2017, 2019, 2022 >> [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
https://www.visualmicro.com/forums/YaBB.pl?num=1581620120

Message started by RobinBlood on Feb 13th, 2020 at 6:55pm

Title: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by RobinBlood on Feb 13th, 2020 at 6:55pm
Hi,

I'm using the Streaming Lib in near enough every project (thanks again Mikal Hart)
I cannot recommend this enough!

I just stumbled across visualmicro to find a solution with the growing number of files in my project. The Import from Arduino to VisualStudio was somewhat ok, but I struggled a lot with the Arduino-Path. I'm using the WindowsStoreApp 1.8.29.0 and it was quite difficult to find the Toolpath.

Anyway, the Project compiles great (what it already did on Arduino) but I've got errors all over every file because I used the streaming.h -> Unfortunately every "endl" shows up as an Error.

also, I had some functions declared after "setup" and "loop" that I needed to prototype in front of them to avoid errors.

And don't get me starting with ArduinoJson.
He doesn't like the classes, the typedefs, the inline-statements or any of it  ;)  but it compiles great  :)

I may need to mention that I've got Resharper Ultimate installed on my VisualStudioPro, so I'm not really sure which one does what but maybe you could look inside it.

Best Regards
Robin

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by Visual Micro on Feb 13th, 2020 at 7:35pm
Hi

We are looking at the new release(s) of the ArduinoJson which does cause a lot of intellisense issues. Older versions of the same library are a lot better but not perfect.

The StreamingLib sounds interesting we will look at that.

The automatic creation of prototypes is currently moving to the same sytem the arduino ide uses. Currently you can enable prototype generation in the Project Properties (F4) which would have then added them for you, however the placement of them will improve further with ctags.

I don't understand this part of your report except to say that windows store app is not supported due to the permissions problems that it brings. Please always install the standard exe arduino ide version or zip from arduino.cc downloads page. If you click the "Download IDE" button on the Visual Micro IDE Locations dialog that takes you to the correct downloads.

I have no idea why you would need to find the toolspaths but I suspect this confusion is due to using th windows store version. In normal use all paths will be found without your having to change anything.




Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by RobinBlood on Feb 13th, 2020 at 8:03pm
Yes, that was probably the reason for the toolpath issue.

I might have adjusted the settings a bit to access the WindowsApps, and it works fine. Can compile without issues.

Attached is one of the occurrences of the "endl" and the dialog that I got when I started VisualStudio with all current (working) settings.
vmicroDialog.jpg ( 118 KB | 4 Downloads )

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by Visual Micro on Feb 13th, 2020 at 8:15pm
I need to see your build output as requested in the yellow box above. In my test with the ArduinoJSON library and Streaming everything is okay. I see there is another library of the same name called ArduinoJson which is the one that gives intellisense errors in our earlier tests.

The ArduinoJSON library is by Arduino

With the following code on an esp32, the "endl" issue does not appear.

I suggest delete myDocuments\Arduino\Libraries\ArduinoJson and install the ArduinoJSON library.

[code]#include <Arduino_JSON.h>
#include <Streaming.h>


const long BAUD = 115200;

const int lettera = 'A';
const int month = 4, day = 17, year = 2009;

const long LOOP_DELAY = 1000;

void setup()
{
  Serial.begin(BAUD);
}

void loop()
{
  Serial << "This is an example of the new streaming" << endl;
  Serial << "library.  This allows you to print variables" << endl;
  Serial << "and strings without having to type line after" << endl;
  Serial << "line of Serial.print() calls.  Examples: " << endl;

  Serial << "A is " << lettera << "." << endl;
  Serial << "The current date is " << day << "-" << month << "-" << year << "." << endl;

  Serial << "You can use modifiers too, for example:" << endl;
  Serial << _BYTE(lettera) << " is " << _HEX(lettera) << " in hex. " << endl;
  Serial << endl;

  delay(LOOP_DELAY);
}
[/code]

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by Visual Micro on Feb 13th, 2020 at 8:22pm
I just retested ArduinoJSON latest library and don't have the issues seen for other boards. So knowing the info requested above will probably help replicate.

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by RobinBlood on Feb 13th, 2020 at 8:55pm

Tim@Visual Micro wrote on Feb 13th, 2020 at 8:15pm:
I need to see your build output as requested in the yellow box above

OR
Click here to Email us with the file attached, and a link to your post
---
Email was sent a few minutes after posting the thread
(bcc to one of my other emails where it arrived at 20:15 GMT+1)

I will strip-down my project and send you a copy with screenshots, this could take an hour ...

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by Visual Micro on Feb 13th, 2020 at 9:04pm
Ah okay I see it. I don't think there is any point in investigating while you are using the windows store ide as back end. It could sent us in circles.

Please download the arduino zip into a simple trusted location such as "c:\arduino\ide" from here https://www.arduino.cc/en/main/software

Then change visual micro IDE location to point to the newly unpacked ide. You can also use the windows installer link above the zip but it does nothing more than install usb drivers you already have installed.

Click Rescan or restart the ide after making the changes to the ide. If your boards are missing then re-enable them in board manager.

After this your toolchains and all build elements will have the correct permissions.




Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by RobinBlood on Feb 13th, 2020 at 10:00pm
Ok, they just released 1.8.12 a few minutes ago :-)
Busy setting up everything, one thing I just realized ...

I have two "Documents" Folders. OneDrive linked the System Folder to its Documents and I have another one below my User. Both had Arduino-Files in them.

I cannot redirect the "Documents" to the subfolder of my User. I will continue anyway and create a new ArduinoProject instead of opening one from my harddrive.

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by RobinBlood on Feb 13th, 2020 at 11:21pm

Tim@Visual Micro wrote on Feb 13th, 2020 at 8:15pm:
I suggest delete myDocuments\Arduino\Libraries\ArduinoJson and install the ArduinoJSON library.

I intentionally use the library "ArduinoJson version 6.14.1" from Benoit Blanchon because I like his Assistant on the Website. It's also used by PlatformIO and works great.

Anyway, Email sent, attached screenshot and console-output is inside the zip. Need to sleep a bit, it's already past midnight  :-/

Thanks for the support and best regards
screenshot_002.jpg ( 349 KB | 2 Downloads )

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by Visual Micro on Feb 14th, 2020 at 12:38am
Thanks, yes it looks brilliant. We will try t resolve those intellisense errors in the next release.

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by RobinBlood on Feb 14th, 2020 at 9:47am
btw. if I switch to an ESP8266-board, the Intellisense errors disappear (except "size_t") build, rebuild, ...
switching back to ESP32 and there they are  ::)
So some part already works, looks like there is an issue with ESP32

Title: Re: [Intellisense Error]Visual Studio 2019 - streaming.h, ArduinoJson and others
Post by Visual Micro on Feb 14th, 2020 at 1:07pm
Thanks for the info. With STM32 the AruinoJson shows 300+ errors so Esp doesn't suffer so much. In any event we will be looking at solutions.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.