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 Resharper with Visual Micro (Read 9000 times)
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Resharper with Visual Micro
Jun 24th, 2016 at 12:52am
Print Post  
Has anybody managed to get Resharper to play nicely with Visual Micro? 

R# flags lots of "cannot resolve symbol" errors due, I think, to the automatic forward declarations performed by vm on .ino files. Is there any way of suppressing these errors?

Thanks

Neil
  
Back to top
 
IP Logged
 
Jo Sto
Ex Member
*


Re: Resharper with Visual Micro
Reply #1 - Jun 24th, 2016 at 10:50am
Print Post  
Are you using c++ version of resharper?
  
Back to top
 
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: Resharper with Visual Micro
Reply #2 - Jun 24th, 2016 at 9:13pm
Print Post  
@Jo - yes of course. 

R# works nicely for me apart from the fact that it does not seem to be able to resolve symbols in .ino files which are declared in some other .ino file. Normal .cpp/.h files are handled OK. That's probably not surprising - R# was presumably not designed with Arduino in mind?? There are some options in R# to disable various types of error checking but I cannot seem to get disable these 'errors'. Any ideas?

Thanks

Neil
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12210
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Resharper with Visual Micro
Reply #3 - Jun 24th, 2016 at 9:28pm
Print Post  
I had the same question as Jo, thanks for clearing that up.

Visual micro, registers .ino file extensions as C++ files so it sounds like r# must have it's own list of file extensions that are considered c++ files.

I know that VisualAssistX keeps its own list in the windows registry so maybe you can see where it stores the list.

If it's a registry key we can try to add to the installer or at least make a note in the docs.

Another think to check is to ensure the .ino files are included with type of "Compile" which sometimes they are not. Take a look at the F4 file properties
« Last Edit: Jun 24th, 2016 at 9:29pm by Tim@Visual Micro »  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: Resharper with Visual Micro
Reply #4 - Jun 25th, 2016 at 6:45am
Print Post  
Perhaps I was not clear enough. R# certainly does handle .ino file extensions as c++ files.

The issue is that it seems to handle them ONLY as c++ files and does not understand the Arduino 'automatic' forward declaration performed by both the Arduino IDE and Visual Micro. 

R# produces red intellisense errors whenever it encounters a symbol in a .ino file which is declared in another .ino file. I can of course remove these errors by explicitly creating forward declarations for each missing symbol in each .ino file - something that is not normally required in the Arduino world. I was just wondering if there might be a way to make R# better understand the Arduino environment and resolve these missing symbols automatically.

Thanks 

Neil
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12210
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Resharper with Visual Micro
Reply #5 - Jun 25th, 2016 at 1:20pm
Print Post  
Thanks for explaining the issue. I notice there is R# and Resharper for C++, I don't know if there is a difference but here is some info.

It is a unique feature of Arduino that allows code in different .ino files to be shared without external declarations. It is one reason why IDE's can not normally compile Arduino code.

Visual Micro found a way that allows the IDE's to work for intellisense but it sounds like Resharper is more accurate than intellisense.

Visual studio does not perform the build process, we don't use the Microsoft build system so Resharper will have a hard time with this.

Maybe it is an idea to raise the request with Resharper.  If Visual Micro can change any project properties to make R# happy then I am happy to look at that.
« Last Edit: Jun 25th, 2016 at 1:20pm by Tim@Visual Micro »  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: Resharper with Visual Micro
Reply #6 - Jun 25th, 2016 at 10:04pm
Print Post  
Thanks for the information Tim. 

Yes indeed, it makes more sense to ask Resharper about issues related to Resharper software and I will do that. 
I just thought that the folks at Resharper are probably less familiar with the quirks of Arduino and I might have a hard time explaining my issue.

Also, you are so quick and helpful that I thought I would try you first! Smiley

Perhaps it's time to give up on .ino files and convert my project to .cpp/.h

Thanks for your input

Neil
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12210
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Resharper with Visual Micro
Reply #7 - Sep 3rd, 2016 at 7:33pm
Print Post  
Hi again

I've been looking at this again and maybe we missed a couple of things ++

1)

When you select a source code file in the solution explorer the F4 properties windows provides the ability to set the "File Type".

Historically the ".ino" type is set to "Document" which we can try to change automatically in future visual micro releases. 

When you click the "File Type" property is provides a list of alternative options. Please try setting it to "C/C++ Code"

2)

If the change of "File Type" doesn't help then the latest Visual Micro release allows you to use a project_name.cpp instead of .ino files.

If you add a project_name.cpp to your project then Visual Micro will not include the .ino files in the compilation and they could in-effect be empty. You must leave a project_name.ino in the project even if empty. 

A project_name.cpp must #include "arduino.h" and you will need to add prototype for each of your functions. Building in Release after switching on "show build folder on the vMicro>Compiler menu" will give you a ready made project_name.cpp containing your combined .ino code and prototypes

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint