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
Hot Topic (More than 8 Replies) Refactor extract new function fails (Read 2244 times)
retiredArduinoGuy
Junior Member
**
Offline


Posts: 14
Joined: Jan 29th, 2020
Refactor extract new function fails
Jan 29th, 2020 at 6:47am
Print Post  
When I mark some code and then r-click to refactor into a new function the dialog pops up and lets me enter the new function name. Clicking ok then causes "failed with unknown error".
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Refactor extract new function fails
Reply #1 - Jan 29th, 2020 at 12:27pm
Print Post  
Visual Micro uses standard VC++ projects and does not intefere in any way with the IDE in the code editor. So your question is more a question for Microsoft. 

Is your code in a .ino file or cpp/h files?
  
Back to top
IP Logged
 
retiredArduinoGuy
Junior Member
**
Offline


Posts: 14
Joined: Jan 29th, 2020
Re: Refactor extract new function fails
Reply #2 - Jan 29th, 2020 at 11:32pm
Print Post  
I've used it hundreds of times with C++ code, it works perfectly every time.
It is .INO.
Does it have something to do with the file being .INO instead of C++?
Can I tell Visual Studio to treat it like C?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Refactor extract new function fails
Reply #3 - Jan 30th, 2020 at 4:03pm
Print Post  
Possibly. Try click the file name in solution explorer and opening the F4 properties. See if changing the file type to c++ helps?
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Refactor extract new function fails
Reply #4 - Jan 31st, 2020 at 1:30pm
Print Post  
Looks like you need to ask Microsoft about this. The .ino files are registered as c++ and the F4 properties show c++ but refactor doesn't work properly. Intellisense works fine so we know we are setup as c++ files correctly.
  
Back to top
IP Logged
 
retiredArduinoGuy
Junior Member
**
Offline


Posts: 14
Joined: Jan 29th, 2020
Re: Refactor extract new function fails
Reply #5 - Feb 3rd, 2020 at 5:41pm
Print Post  
I'll check with Microsoft. I used to know a couple of engineers up there before I retired.
Thanks for looking into it. I have found after more testing that it does sometimes work, but I haven't narrowed down why.
Other than that I am extremely satisfied with your product. I use it almost everyday, it is so much better than the Arduino IDE!
I do miss the C# debugging, but then I admit I'm not working on the same level of software complexity that I used to.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Refactor extract new function fails
Reply #6 - Feb 3rd, 2020 at 5:44pm
Print Post  
Great to hear that thanks. If your hardware and project supports it the GDB debugging is a big step closer to the c# debugger.
  
Back to top
IP Logged
 
retiredArduinoGuy
Junior Member
**
Offline


Posts: 14
Joined: Jan 29th, 2020
Re: Refactor extract new function fails
Reply #7 - Feb 6th, 2020 at 4:49pm
Print Post  
That sounds interesting about gdb, I don't know anything about it or what it requires yet. I'm working mostly with Arduino Mega and Uno boards.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Refactor extract new function fails
Reply #8 - Feb 6th, 2020 at 5:37pm
Print Post  
The avr boards that you have require a hardware debugger such as Atmel ICE but they are still a bit cumbersome to use.

However, you can use a simple project to get a taste of hardware debugging using the GDBStub option. 
https://www.visualmicro.com/page/AVR-Debugging.aspx





  
Back to top
IP Logged
 
retiredArduinoGuy
Junior Member
**
Offline


Posts: 14
Joined: Jan 29th, 2020
Re: Refactor extract new function fails
Reply #9 - Feb 6th, 2020 at 5:59pm
Print Post  
I like the look of that screen!
What development boards, if any, include the HW debugger?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint