Is there something like [Tooltip()] attribute?

Hi there, in Unity I make intense use of the [Tooltip()] attribute, but can’t find something comparable in Needle. When I write a tooltip in the C# sidecar class, the tooltip is gone the next time I change the TS script.

Original Post on Discord

by user 689743366355025931

Hi, that’s something I was missing a couple of times as well - I’ll make a task for that to add it

I’m all for not documenting in code because it should be self-explanatory, but for the user front end in Unity I often use it for clarification. So thumbs up for this feature. :slightly_smiling_face:

by user 689743366355025931

If you run a clean install the component compiler will update and you should be able to write tooltips like this

I will not be able to solve this. This is what I tried so far.

//@tooltip 11 If true, the element will be hidden on enable and shown on disable
switchOnEnableDisable: boolean = true;

//@tooltip 22 If true, the element will be hidden on enable and shown on disable
switchOnStartDestroy: boolean = false;

//@tooltip Foo is bar
foobar: boolean = false;

by user 689743366355025931

Where is your script in the project? Is in in src/scripts ?

Yes. It is \src\scripts\ToggleHTMLElement.ts

by user 689743366355025931

and what version of the component compiler do you see?

Cases 1 and 3 work for me (in your example above)

1.9.4 … maybe I’am out dated?

by user 689743366355025931

Can you try running a clean install? Via Alt+Install on the ExportInfo

The tooltip was added in 1.10.0

Ahh… OK! The clean install raised the Generator version. And now Tooltips are present. Thank you.

Fyi: while the update Unity Console puts out some errors like “EBUSY: resource busy or locked”. This is because VSCode or VS or bothe are locking some Unity files. Solution to this is simply closing VSCode & VS and try again. :wink:

by user 689743366355025931

Yes im aware of that but im not sure what a good solution is (since files can be locked by any process technically) - do you think adding a special log when this message appears with some potential reasons would help?

E.g. along the lines of “this may be of visual studio code…”

It is an UNity “bug” or behaviour that I conquer for years. Its has nothing to do with Needle. But faceing this issue sometime needs lots of time to tackle, so I do want inform about that. :slightly_smiling_face:

by user 689743366355025931

I think in this case (when you run Clean Install and you see the message) then it’s sometimes VSCode that is locking files and not Unity’s fault^^

At least I’ve had this multiple times