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


Posts: 147
Location: So. Calif. US
Joined: Jun 16th, 2013
Editor: Avoiding editing main cpp rather than ino
May 2nd, 2014 at 7:29pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Editor: Avoiding editing main cpp rather than ino
Reply #1 - May 3rd, 2014 at 1:46pm
Print Post  
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
Location: So. Calif. US
Joined: Jun 16th, 2013
Re: Editor: Avoiding editing main cpp rather than ino
Reply #2 - May 5th, 2014 at 1:40am
Print Post  
Tim@Visual Micro wrote on May 3rd, 2014 at 1: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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Editor: Avoiding editing main cpp rather than ino
Reply #3 - May 6th, 2014 at 7:23pm
Print Post  
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
Location: So. Calif. US
Joined: Jun 16th, 2013
Re: Editor: Avoiding editing main cpp rather than ino
Reply #4 - May 7th, 2014 at 4:19pm
Print Post  
Tim@Visual Micro wrote on May 6th, 2014 at 7: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
« Last Edit: May 7th, 2014 at 4:22pm by stevech »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Editor: Avoiding editing main cpp rather than ino
Reply #5 - May 11th, 2014 at 4:06pm
Print Post  
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 TopicPrint