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 Syntax Tool Tip Not Working Correctly (Read 5853 times)
Eric Bartha
Newbies
*
Offline


Posts: 4
Joined: Dec 19th, 2016
Syntax Tool Tip Not Working Correctly
Dec 19th, 2016 at 11:51pm
Print Post  
Hello everyone -

I am new to Visual Micro and Visual Studio (and Arduino, for that matter) and have a question. The Syntax "tooltip" is displaying undesired variable names, not what the syntax really is. Also, a lot of times I do not even get the pop-up. Secondly, I noticed a lot of functions do not have a suggested completion at all, like "tune."

I read through a lot of the help guides but cannot find an answer. I did just re-install it, to no avail.

I've attached a picture of what I am talking about. Any suggestions?

Thanks!
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Syntax Tool Tip Not Working Correctly
Reply #1 - Dec 20th, 2016 at 12:27am
Print Post  
Hi,

All visual studio versions, arduino versions and all types of arduino boards work differently 

So please say which Ide versions and which board

and confirm if you have built the project yet or not?

Thanks
  
Back to top
IP Logged
 
Eric Bartha
Newbies
*
Offline


Posts: 4
Joined: Dec 19th, 2016
Re: Syntax Tool Tip Not Working Correctly
Reply #2 - Dec 20th, 2016 at 1:02am
Print Post  
Thanks for the reply.

I am using an Arduino branded Uno and IDE 1.6.10.

The project is unbuilt at this point.

Thank you  Smiley

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


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Syntax Tool Tip Not Working Correctly
Reply #3 - Dec 20th, 2016 at 1:09am
Print Post  
Hi,

The definition for pinMode is as follows and that is what the tool tips display.

Code
Select All
void pinMode(uint8_t, uint8_t); 



The definition for tone is lower case and will show a tip as follows:-

Code
Select All
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0); 



The tips shows you what is actually defined for the Arduino method and allow you to see what is expected, they do not show your variable definitions. For that you have to hover over a variable.

Does this help or have I missed the point?



« Last Edit: Dec 20th, 2016 at 1:11am by Tim@Visual Micro »  
Back to top
IP Logged
 
Eric Bartha
Newbies
*
Offline


Posts: 4
Joined: Dec 19th, 2016
Re: Syntax Tool Tip Not Working Correctly
Reply #4 - Dec 20th, 2016 at 1:14am
Print Post  
When you look at the syntax for pinMode on Arduino.cc, it says the syntax is pinMode(pin, mode), not uint8_t. I guess my question is what is uint8_t and why is that showing instead of the documented syntax per arduino.cc?

https://www.arduino.cc/en/Reference/PinMode

Same with the syntax for tone (tone(pin, frequency, duration)). But, my point with tone, is that it is not even an option (see attached img). Disregard this, tone was not showing up before, but I just went to take a screenshot and now it is there....  Shocked Shocked Lips Sealed Embarrassed

Again, thanks for the support.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Syntax Tool Tip Not Working Correctly
Reply #5 - Dec 20th, 2016 at 1:43am
Print Post  
I see thanks. Good question!

Visual studio is correctly showing the tip. The problem is that arduino have not defined the names in the prototypes.I just looked at other hardware such as esp8266 and it has the names defined.

If you click on pinMode then press F12 you will see the definition in the arduino.h which is installed with the arduino ide.

Code
Select All
void pinMode(uint8_t, uint8_t); 



Esp8266 has this in its arduino.h

Code
Select All
void pinMode(uint8_t pin, uint8_t mode); 



To be fair to arduino there are a number of manufacturers that haven;t defined the names and it might be that they have a long history when adding names to prototypes wasn't allowed. (I'm not sure if that's true or not)

You can also right click and "Peek Definition" if that's easier than F12 (goto definition).

Having said all that I have found a problem that I will look into. If you click "vMicro>Toggle Hidden Files" shortcuts to the arduino core are added to the current project. If you end up with lots of folders in the root then close and reopen the project (okay to save changes) and the view will refresh properly. You will see all the arduino source in the \src folder. 

You will get a lot of intellisense errors which I will look into but pressing F12 on pinmode will then show the pinMode method instead of the prototype. If intellisense errors annoy set the filter on the errors list to "open documents"

Click "vMicro>Toggle Hidden Files" again to remove the links to the arduino core (or delete manually). they do not harm if they exist in a project.
















  
Back to top
IP Logged
 
Eric Bartha
Newbies
*
Offline


Posts: 4
Joined: Dec 19th, 2016
Re: Syntax Tool Tip Not Working Correctly
Reply #6 - Dec 20th, 2016 at 2:02am
Print Post  
Thanks for the info. That does make sense now seeing these core files, like wiring_digital.c.

It is unfortunate that the tooltip (IntelliSense?) does not display an alternative, "human readable" syntax, like those on the reference page of arduino.cc.

Good thing as I program more and more it starts to burn into my brain.  Wink The F12 trick should suffice for when I cannot remember, albeit not ideal.

Thank you!  Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Syntax Tool Tip Not Working Correctly
Reply #7 - Dec 20th, 2016 at 2:14am
Print Post  
I,m sure earlier versions of vs handled this better. I will do some testing. Thanks for the post
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint