Replies: 2 comments 4 replies
-
The way you have accomplished this here with markdown is really the only solution right now. There is no annotation tag for a heading or label, the way you mention. There is an For implementing it yourself, you can try taking a look at Another thing you can do to make it stand out is to use markdown headings: ---## SERVER
---@param player player The player to target
function setCameraTarget(player) end Just be careful as descriptions written after a heading will need an empty line of |
Beta Was this translation helpful? Give feedback.
-
Another thing we could take a look at is how you have your definition files set up. Presumably you have some files that provide annotations for the various client and server functions. These are hopefully also in separate files or folders, You may be able to set up your workspace so that it can emulate the environments as closely as possible, offering only the functions you will have access to in each respective environment. Let me know what the situation is with the definition files and we may be able to sort this out 🙂 |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to prepare docstrings for Multi Theft Auto: San Andreas Lua scripting API and I have multiple cases of a single function name having multiple signatures and, more importantly, a big differentiator of being "serverside" (run on server) and/or "clientside" (run on client). I would like to somehow emphasize this property for annotations for functions which are both "serverside" and "clientside". A "Resource" in MTA:SA can consist of multiple scripts for both serverside and clientside, sometimes even a single script file is used on both. Using only overloads is not the best solution here, unfortunately, because it does not convey which function definition is for which execution context.
Here are links to two example functions on MTA:SA wiki:
https://wiki.multitheftauto.com/wiki/BindKey - has four separate signatures: 2 for serverside and 2 for clientside
https://wiki.multitheftauto.com/wiki/SetCameraTarget - three separate signatues: 1 for serverside and 2 for clientside
Here's my attempt at creating docstrings for the second function, and a screenshot of it in VS Code:
Being able to show the "SERVERSIDE" or "CLIENTSIDE" information above each function signature would be extremely helpful.
Could someone point me in the direction of implementing that in a PR (info which files I should modify, for example)? Perhaps something like
---@header <text>
sounds good?Beta Was this translation helpful? Give feedback.
All reactions