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
Editor: Avoiding editing main cpp rather than ino (Read 5438 times)
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Editor: Avoiding editing main cpp rather than ino
May 2nd, 2014 at 8:29pm
 
When using the GO button, for example, often a tab is opened with the cpp version of the ino file. Because there are 8 or so other files open with tabs in the editor, I too often wind up changing the cpp instead of the ino. Those changes are then lost.

Any way to avoid this?
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10620
United Kingdom
Re: Editor: Avoiding editing main cpp rather than ino
Reply #1 - May 3rd, 2014 at 2:46pm
 
Hi,

The temp .cpp build file is not opened as a result of the build process. It is more likely that you double clicked (drill down) a compiler error and Visual Micro incorrectly opened the .cpp file instead of the correct line of the respective .ino file

If you see an error that behaves in this way please post your error so we can tighten up the error translation routine.

All .ino files are combined into the .cpp during build so Visual Micro has to translate line numbers from .cpp to a valid .ino. Hence the opportunity for this error.

Thanks
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Editor: Avoiding editing main cpp rather than ino
Reply #2 - May 5th, 2014 at 2:40am
 
Visual Micro wrote on May 3rd, 2014 at 2:46pm:
Hi,

The temp .cpp build file is not opened as a result of the build process. It is more likely that you double clicked (drill down) a compiler error and Visual Micro incorrectly opened the .cpp file instead of the correct line of the respective .ino file

If you see an error that behaves in this way please post your error so we can tighten up the error translation routine.

All .ino files are combined into the .cpp during build so Visual Micro has to translate line numbers from .cpp to a valid .ino. Hence the opportunity for this error.

Thanks


I will look.

I think it's not based on an error.. but rather clicking on something like a function name and then clicking the GO button - that takes me to the cpp of the same root name as the ino file.

Indeed, I think it's possible to not use an ino file, with VM/VS, right?

Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10620
United Kingdom
Re: Editor: Avoiding editing main cpp rather than ino
Reply #3 - May 6th, 2014 at 8:23pm
 
No, you have to use .ino (at the moment)

The .cpp is only ever created in the temp build folder and is unknown to atmel studio. It can only appear as a result of clicking an error but should never appear if visual micro does it's job properly!
Back to top
 
WWW  
IP Logged
 
stevech
Member
***
Offline



Posts: 147
So. Calif. US
Re: Editor: Avoiding editing main cpp rather than ino
Reply #4 - May 7th, 2014 at 5:19pm
 
Visual Micro wrote on May 6th, 2014 at 8:23pm:
No, you have to use .ino (at the moment)

The .cpp is only ever created in the temp build folder and is unknown to atmel studio. It can only appear as a result of clicking an error but should never appear if visual micro does it's job properly!


Ah, if error. That's probably the issue. I do a compile, get an error in the output window. Of course, I click on that to see the errored code. That takes me to the cpp rather than the ino from which the cpp was produced.

I edit the cpp as I'm concentrating on the error, not the IDE. Alas, this correcting work is lost.

This seems to be a VM issue at the root, due to the dumb ino file convention.

It's hard to remember to avoid this trap. Wish VM could deal with it.


Flaws yes, but infinitely better than the Arduino IDE
Back to top
« Last Edit: May 7th, 2014 at 5:22pm by stevech »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10620
United Kingdom
Re: Editor: Avoiding editing main cpp rather than ino
Reply #5 - May 11th, 2014 at 5:06pm
 
Thanks. As mentioned previously please give an example of an error that is not being re-formatted correctly by Visual Micro.

Most errors are handled correctly and we can correct any examples that fall outside fo the current conversation rules.
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print