Use Method & Property Descriptions

In my opinion, one of the Xojo IDE’s greatest strengths is its autocomplete engine. Whilst it isn’t perfect (Using clauses I’m looking at you :crazy_face:) I think it’s pretty impressive. One of the features that I like is the description pane (@npalardy might know its actual name):

As you can see, when you hover over a method or property, the method signature is displayed but also underneath you may be treated to a description of the item

Did you know that you can add descriptions to methods and properties that you create in your own classes and methods? This is a really good way not only to help annotate your code if you share it and make it easier for other developers to use but I find it a really good self-documenting mechanism to help me remember what a method or property is for simply by hovering my mouse cursor over the code in the editor.

Here’s an example of it in action, hovering over a simple method on a Vector class I have:

Notice how the description pane at the bottom not only provides the method signature but also provides a description of what the method does: “Divides this vector by the given scalar and returns this vector.”.

How do I do this?

Adding descriptions to methods or properties is really easy. Add the method / property as usual and then in the right hand inspector pane, click the “cog/settings” button. Then just enter the text you want to appear in the Description test field:

I strongly encourage you use this feature if you don’t already as I find it invaluable.

1 Like

Nice one. Never used it but will from now on. Thanks!

1 Like

This is super awesome Garry!

thank you for sharing

1 Like

FYI - that one you can blame me for :stuck_out_tongue:

Consider yourself blamed … :grin:

It’s probably one of my favourite features in the whole IDE so thanks Norm!

I do wish however that you’d made it possible to resize the description pane at the bottom of the window so you can see longer descriptions.

Yes. I remember bringing up a Feature request, but I couldn’t make myself clear I guess. Reading a long description can sometimes become a tricky task when you try to navigate the mouse to the description pane without touching other code.

Yeah me too (Feedback 56010) - it’s been reviewed but no sign of it being implemented. It’s a shame because it seems like a small change but I think it would help a lot.

Welcome to the forum Ulrich - great tp see you here!

1 Like

Long descriptions should have a little set of scrollers at the right hand side

I hadn’t noticed that before. You are correct that if you are able to gingerly move your mouse down to the bottom of the IDE without hovering over any other symbols at all, you can indeed scroll the description.

I still say a resizing handle is needed :smile:.

dont disagree - just didnt ever get to doing it in that editor as its a bit of a bear already