Browse Source

Unconditionally use variants key;

Currently only functions with multiple variants use the variants table,
and functions with a single variant use an array of arguments/returns.
This means that there's less typing for single-variant functions, but
it's really annoying to change between the 2 different syntaxes.

Instead, just always be explicit about the variants and use string key
for arguments/returns tables.
bjorn 3 years ago
parent
commit
fc9ffd996c
100 changed files with 825 additions and 432 deletions
  1. 9 6
      api/lovr/audio/getAbsorption.lua
  2. 8 4
      api/lovr/audio/getDevices.lua
  3. 10 8
      api/lovr/audio/getOrientation.lua
  4. 13 14
      api/lovr/audio/getPose.lua
  5. 9 6
      api/lovr/audio/getPosition.lua
  6. 7 2
      api/lovr/audio/getSampleRate.lua
  7. 7 2
      api/lovr/audio/getSpatializer.lua
  8. 8 4
      api/lovr/audio/getVolume.lua
  9. 8 4
      api/lovr/audio/isStarted.lua
  10. 9 6
      api/lovr/audio/setAbsorption.lua
  11. 11 10
      api/lovr/audio/setDevice.lua
  12. 11 9
      api/lovr/audio/setOrientation.lua
  13. 13 14
      api/lovr/audio/setPose.lua
  14. 10 7
      api/lovr/audio/setPosition.lua
  15. 8 4
      api/lovr/audio/setVolume.lua
  16. 8 4
      api/lovr/audio/start.lua
  17. 8 4
      api/lovr/audio/stop.lua
  18. 7 1
      api/lovr/event/clear.lua
  19. 7 2
      api/lovr/event/poll.lua
  20. 6 0
      api/lovr/event/pump.lua
  21. 7 2
      api/lovr/event/push.lua
  22. 7 2
      api/lovr/event/quit.lua
  23. 6 0
      api/lovr/event/restart.lua
  24. 8 4
      api/lovr/filesystem/createDirectory.lua
  25. 7 2
      api/lovr/filesystem/getAppdataDirectory.lua
  26. 8 4
      api/lovr/filesystem/getDirectoryItems.lua
  27. 7 2
      api/lovr/filesystem/getExecutablePath.lua
  28. 7 2
      api/lovr/filesystem/getIdentity.lua
  29. 8 4
      api/lovr/filesystem/getLastModified.lua
  30. 8 4
      api/lovr/filesystem/getRealDirectory.lua
  31. 7 2
      api/lovr/filesystem/getRequirePath.lua
  32. 7 2
      api/lovr/filesystem/getSaveDirectory.lua
  33. 8 4
      api/lovr/filesystem/getSize.lua
  34. 7 2
      api/lovr/filesystem/getSource.lua
  35. 7 2
      api/lovr/filesystem/getUserDirectory.lua
  36. 7 2
      api/lovr/filesystem/getWorkingDirectory.lua
  37. 8 4
      api/lovr/filesystem/isDirectory.lua
  38. 8 4
      api/lovr/filesystem/isFile.lua
  39. 7 2
      api/lovr/filesystem/isFused.lua
  40. 8 4
      api/lovr/filesystem/load.lua
  41. 11 10
      api/lovr/filesystem/mount.lua
  42. 8 4
      api/lovr/filesystem/newBlob.lua
  43. 10 8
      api/lovr/filesystem/read.lua
  44. 8 4
      api/lovr/filesystem/remove.lua
  45. 8 3
      api/lovr/filesystem/setIdentity.lua
  46. 7 2
      api/lovr/filesystem/setRequirePath.lua
  47. 8 3
      api/lovr/filesystem/setSource.lua
  48. 8 4
      api/lovr/filesystem/unmount.lua
  49. 10 8
      api/lovr/graphics/getBackgroundColor.lua
  50. 7 2
      api/lovr/graphics/getDefaultFont.lua
  51. 7 2
      api/lovr/graphics/getDevice.lua
  52. 7 2
      api/lovr/graphics/getFeatures.lua
  53. 7 2
      api/lovr/graphics/getLimits.lua
  54. 7 2
      api/lovr/graphics/getStats.lua
  55. 7 2
      api/lovr/graphics/getWindowPass.lua
  56. 8 4
      api/lovr/graphics/isFormatSupported.lua
  57. 8 4
      api/lovr/graphics/newSampler.lua
  58. 10 8
      api/lovr/graphics/newTally.lua
  59. 6 0
      api/lovr/graphics/present.lua
  60. 6 0
      api/lovr/graphics/wait.lua
  61. 9 6
      api/lovr/headset/animate.lua
  62. 10 8
      api/lovr/headset/getAngularVelocity.lua
  63. 8 4
      api/lovr/headset/getAxis.lua
  64. 7 2
      api/lovr/headset/getBoundsDepth.lua
  65. 8 4
      api/lovr/headset/getBoundsDimensions.lua
  66. 8 4
      api/lovr/headset/getBoundsGeometry.lua
  67. 7 2
      api/lovr/headset/getBoundsWidth.lua
  68. 8 4
      api/lovr/headset/getClipDistance.lua
  69. 8 4
      api/lovr/headset/getDisplayDimensions.lua
  70. 7 2
      api/lovr/headset/getDisplayFrequencies.lua
  71. 7 2
      api/lovr/headset/getDisplayFrequency.lua
  72. 7 2
      api/lovr/headset/getDisplayHeight.lua
  73. 7 2
      api/lovr/headset/getDisplayMask.lua
  74. 7 2
      api/lovr/headset/getDisplayWidth.lua
  75. 7 2
      api/lovr/headset/getHands.lua
  76. 7 2
      api/lovr/headset/getMirrorTexture.lua
  77. 7 2
      api/lovr/headset/getName.lua
  78. 11 10
      api/lovr/headset/getOrientation.lua
  79. 7 2
      api/lovr/headset/getOriginType.lua
  80. 7 2
      api/lovr/headset/getPass.lua
  81. 14 16
      api/lovr/headset/getPose.lua
  82. 10 8
      api/lovr/headset/getPosition.lua
  83. 7 2
      api/lovr/headset/getTime.lua
  84. 10 8
      api/lovr/headset/getVelocity.lua
  85. 11 10
      api/lovr/headset/getViewAngles.lua
  86. 7 2
      api/lovr/headset/getViewCount.lua
  87. 14 16
      api/lovr/headset/getViewPose.lua
  88. 9 6
      api/lovr/headset/isDown.lua
  89. 9 6
      api/lovr/headset/isTouched.lua
  90. 8 4
      api/lovr/headset/isTracked.lua
  91. 9 6
      api/lovr/headset/newModel.lua
  92. 13 2
      api/lovr/headset/renderTo.lua
  93. 8 4
      api/lovr/headset/setClipDistance.lua
  94. 8 4
      api/lovr/headset/setDisplayFrequency.lua
  95. 11 10
      api/lovr/headset/vibrate.lua
  96. 9 6
      api/lovr/headset/wasPressed.lua
  97. 9 6
      api/lovr/headset/wasReleased.lua
  98. 7 1
      api/lovr/math/drain.lua
  99. 7 2
      api/lovr/math/getRandomSeed.lua
  100. 9 6
      api/lovr/math/randomNormal.lua

+ 9 - 6
api/lovr/audio/getAbsorption.lua

@@ -10,22 +10,25 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'low',
+    low = {
       type = 'number',
       type = 'number',
       description = 'The absorption coefficient for the low frequency band.'
       description = 'The absorption coefficient for the low frequency band.'
     },
     },
-    {
-      name = 'mid',
+    mid = {
       type = 'number',
       type = 'number',
       description = 'The absorption coefficient for the mid frequency band.'
       description = 'The absorption coefficient for the mid frequency band.'
     },
     },
-    {
-      name = 'high',
+    high = {
       type = 'number',
       type = 'number',
       description = 'The absorption coefficient for the high frequency band.'
       description = 'The absorption coefficient for the high frequency band.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'low', 'mid', 'high' }
+    }
+  },
   notes = [[
   notes = [[
     Absorption is currently only supported by the phonon spatializer.
     Absorption is currently only supported by the phonon spatializer.
 
 

+ 8 - 4
api/lovr/audio/getDevices.lua

@@ -8,16 +8,14 @@ return {
     To use a specific device id for playback or capture, pass it to `lovr.audio.setDevice`.
     To use a specific device id for playback or capture, pass it to `lovr.audio.setDevice`.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       type = 'AudioType',
       default = [['playback']],
       default = [['playback']],
       description = 'The type of devices to query (playback or capture).'
       description = 'The type of devices to query (playback or capture).'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'devices',
+    devices = {
       type = 'table',
       type = 'table',
       description = 'The list of devices.',
       description = 'The list of devices.',
       table = {
       table = {
@@ -39,6 +37,12 @@ return {
       }
       }
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'devices' }
+    }
+  },
   related = {
   related = {
     'lovr.audio.setDevice',
     'lovr.audio.setDevice',
     'lovr.audio.start',
     'lovr.audio.start',

+ 10 - 8
api/lovr/audio/getOrientation.lua

@@ -6,27 +6,29 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The number of radians the listener is rotated around its axis of rotation.'
       description = 'The number of radians the listener is rotated around its axis of rotation.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   related = {
   related = {
     'lovr.audio.getPosition',
     'lovr.audio.getPosition',
     'lovr.audio.getPose',
     'lovr.audio.getPose',

+ 13 - 14
api/lovr/audio/getPose.lua

@@ -4,42 +4,41 @@ return {
   description = 'Returns the position and orientation of the virtual audio listener.',
   description = 'Returns the position and orientation of the virtual audio listener.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x position of the listener, in meters.'
       description = 'The x position of the listener, in meters.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y position of the listener, in meters.'
       description = 'The y position of the listener, in meters.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z position of the listener, in meters.'
       description = 'The z position of the listener, in meters.'
     },
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The number of radians the listener is rotated around its axis of rotation.'
       description = 'The number of radians the listener is rotated around its axis of rotation.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   related = {
   related = {
     'lovr.audio.getPosition',
     'lovr.audio.getPosition',
     'lovr.audio.getOrientation',
     'lovr.audio.getOrientation',

+ 9 - 6
api/lovr/audio/getPosition.lua

@@ -4,20 +4,23 @@ return {
   description = 'Returns the position of the virtual audio listener, in meters.',
   description = 'Returns the position of the virtual audio listener, in meters.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x position of the listener.'
       description = 'The x position of the listener.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y position of the listener.'
       description = 'The y position of the listener.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z position of the listener.'
       description = 'The z position of the listener.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/audio/getSampleRate.lua

@@ -6,12 +6,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'rate',
+    rate = {
       type = 'number',
       type = 'number',
       description = 'The sample rate of the playback device, in Hz.'
       description = 'The sample rate of the playback device, in Hz.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'rate' }
+    }
+  },
   related = {
   related = {
     'lovr.conf'
     'lovr.conf'
   }
   }

+ 7 - 2
api/lovr/audio/getSpatializer.lua

@@ -10,12 +10,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'spatializer',
+    spatializer = {
       type = 'string',
       type = 'string',
       description = 'The name of the active spatializer.'
       description = 'The name of the active spatializer.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'spatializer' }
+    }
+  },
   notes = [[
   notes = [[
     Using a feature or effect that is not supported by the current spatializer will not error, it
     Using a feature or effect that is not supported by the current spatializer will not error, it
     just won't do anything.
     just won't do anything.

+ 8 - 4
api/lovr/audio/getVolume.lua

@@ -6,19 +6,23 @@ return {
     this factor.
     this factor.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'units',
+    units = {
       type = 'VolumeUnit',
       type = 'VolumeUnit',
       default = [['linear']],
       default = [['linear']],
       description = 'The units to return (linear or db).'
       description = 'The units to return (linear or db).'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'volume',
+    volume = {
       type = 'number',
       type = 'number',
       description = 'The master volume.'
       description = 'The master volume.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'units' },
+      returns = { 'volume' }
+    }
+  },
   notes = 'The default volume is 1.0 (0 dB).'
   notes = 'The default volume is 1.0 (0 dB).'
 }
 }

+ 8 - 4
api/lovr/audio/isStarted.lua

@@ -3,20 +3,24 @@ return {
   summary = 'Check if an audio device is started.',
   summary = 'Check if an audio device is started.',
   description = 'Returns whether an audio device is started.',
   description = 'Returns whether an audio device is started.',
   arguments = {
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       type = 'AudioType',
       default = [['playback']],
       default = [['playback']],
       description = 'The type of device to check.'
       description = 'The type of device to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'started',
+    started = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the device is active.'
       description = 'Whether the device is active.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'started' }
+    }
+  },
   related = {
   related = {
     'lovr.audio.start',
     'lovr.audio.start',
     'lovr.audio.stop'
     'lovr.audio.stop'

+ 9 - 6
api/lovr/audio/setAbsorption.lua

@@ -9,23 +9,26 @@ return {
     and stuff.
     and stuff.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'low',
+    low = {
       type = 'number',
       type = 'number',
       description = 'The absorption coefficient for the low frequency band.'
       description = 'The absorption coefficient for the low frequency band.'
     },
     },
-    {
-      name = 'mid',
+    mid = {
       type = 'number',
       type = 'number',
       description = 'The absorption coefficient for the mid frequency band.'
       description = 'The absorption coefficient for the mid frequency band.'
     },
     },
-    {
-      name = 'high',
+    high = {
       type = 'number',
       type = 'number',
       description = 'The absorption coefficient for the high frequency band.'
       description = 'The absorption coefficient for the high frequency band.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'low', 'mid', 'high' },
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     Absorption is currently only supported by the phonon spatializer.
     Absorption is currently only supported by the phonon spatializer.
 
 

+ 11 - 10
api/lovr/audio/setDevice.lua

@@ -24,38 +24,39 @@ return {
     try the device in exclusive mode, switching to shared if it doesn't work.
     try the device in exclusive mode, switching to shared if it doesn't work.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       type = 'AudioType',
       default = [['playback']],
       default = [['playback']],
       description = 'The device to switch.'
       description = 'The device to switch.'
     },
     },
-    {
-      name = 'id',
+    id = {
       type = 'userdata',
       type = 'userdata',
       default = 'nil',
       default = 'nil',
       description = 'The id of the device to use, or `nil` to use the default device.'
       description = 'The id of the device to use, or `nil` to use the default device.'
     },
     },
-    {
-      name = 'sink',
+    sink = {
       type = 'Sound',
       type = 'Sound',
       default = 'nil',
       default = 'nil',
       description = 'An optional audio stream to use as a sink for the device.'
       description = 'An optional audio stream to use as a sink for the device.'
     },
     },
-    {
-      name = 'mode',
+    mode = {
       type = 'AudioShareMode',
       type = 'AudioShareMode',
       default = 'shared',
       default = 'shared',
       description = 'The sharing mode for the device.'
       description = 'The sharing mode for the device.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether creating the audio device succeeded.'
       description = 'Whether creating the audio device succeeded.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'type', 'id', 'sink', 'mode' },
+      returns = { 'success' }
+    }
+  },
   related = {
   related = {
     'lovr.audio.getDevices',
     'lovr.audio.getDevices',
     'lovr.audio.start',
     'lovr.audio.start',

+ 11 - 9
api/lovr/audio/setOrientation.lua

@@ -3,26 +3,28 @@ return {
   summary = 'Set the orientation of the listener.',
   summary = 'Set the orientation of the listener.',
   description = 'Sets the orientation of the virtual audio listener in angle/axis representation.',
   description = 'Sets the orientation of the virtual audio listener in angle/axis representation.',
   arguments = {
   arguments = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The number of radians the listener should be rotated around its rotation axis.'
       description = 'The number of radians the listener should be rotated around its rotation axis.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'angle', 'ax', 'ay', 'az' },
+      returns = {}
+    }
+  }
 }
 }

+ 13 - 14
api/lovr/audio/setPose.lua

@@ -3,43 +3,42 @@ return {
   summary = 'Set the pose of the listener.',
   summary = 'Set the pose of the listener.',
   description = 'Sets the position and orientation of the virtual audio listener.',
   description = 'Sets the position and orientation of the virtual audio listener.',
   arguments = {
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x position of the listener, in meters.'
       description = 'The x position of the listener, in meters.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y position of the listener, in meters.'
       description = 'The y position of the listener, in meters.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z position of the listener, in meters.'
       description = 'The z position of the listener, in meters.'
     },
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The number of radians the listener is rotated around its axis of rotation.'
       description = 'The number of radians the listener is rotated around its axis of rotation.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' },
+      returns = {}
+    }
+  },
   related = {
   related = {
     'lovr.audio.setPosition',
     'lovr.audio.setPosition',
     'lovr.audio.setOrientation',
     'lovr.audio.setOrientation',

+ 10 - 7
api/lovr/audio/setPosition.lua

@@ -3,21 +3,24 @@ return {
   summary = 'Set the position of the listener.',
   summary = 'Set the position of the listener.',
   description = 'Sets the position of the virtual audio listener, in meters.',
   description = 'Sets the position of the virtual audio listener, in meters.',
   arguments = {
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x position of the listener.'
       description = 'The x position of the listener.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y position of the listener.'
       description = 'The y position of the listener.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z position of the listener.'
       description = 'The z position of the listener.'
     }
     }
   },
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'x', 'y', 'z' },
+      returns = {}
+    }
+  }
 }
 }

+ 8 - 4
api/lovr/audio/setVolume.lua

@@ -6,18 +6,22 @@ return {
     factor.
     factor.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'volume',
+    volume = {
       type = 'number',
       type = 'number',
       description = 'The master volume.'
       description = 'The master volume.'
     },
     },
-    {
-      name = 'units',
+    units = {
       type = 'VolumeUnit',
       type = 'VolumeUnit',
       default = [['linear']],
       default = [['linear']],
       description = 'The units of the value.'
       description = 'The units of the value.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'volume', 'units' },
+      returns = {}
+    }
+  },
   notes = 'The volume will be clamped to a 0-1 range (0 dB).'
   notes = 'The volume will be clamped to a 0-1 range (0 dB).'
 }
 }

+ 8 - 4
api/lovr/audio/start.lua

@@ -6,20 +6,24 @@ return {
     and started, but this can be controlled using the `t.audio.start` flag in `lovr.conf`.
     and started, but this can be controlled using the `t.audio.start` flag in `lovr.conf`.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       type = 'AudioType',
       default = [['playback']],
       default = [['playback']],
       description = 'The type of device to start.'
       description = 'The type of device to start.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'started',
+    started = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the device was successfully started.'
       description = 'Whether the device was successfully started.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'started' }
+    }
+  },
   notes = [[
   notes = [[
     Starting an audio device may fail if:
     Starting an audio device may fail if:
 
 

+ 8 - 4
api/lovr/audio/stop.lua

@@ -8,20 +8,24 @@ return {
     - No device was initialized with `lovr.audio.setDevice`
     - No device was initialized with `lovr.audio.setDevice`
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       type = 'AudioType',
       default = [['playback']],
       default = [['playback']],
       description = 'The type of device to stop.'
       description = 'The type of device to stop.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'stopped',
+    stopped = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the device was successfully stopped.'
       description = 'Whether the device was successfully stopped.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'stopped' }
+    }
+  },
   notes = 'Switching devices with `lovr.audio.setDevice` will stop the existing one.',
   notes = 'Switching devices with `lovr.audio.setDevice` will stop the existing one.',
   related = {
   related = {
     'lovr.audio.getDevices',
     'lovr.audio.getDevices',

+ 7 - 1
api/lovr/event/clear.lua

@@ -2,5 +2,11 @@ return {
   summary = 'Clear the event queue.',
   summary = 'Clear the event queue.',
   description = 'Clears the event queue, removing any unprocessed events.',
   description = 'Clears the event queue, removing any unprocessed events.',
   arguments = {},
   arguments = {},
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  }
 }
 }

+ 7 - 2
api/lovr/event/poll.lua

@@ -8,12 +8,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'iterator',
+    iterator = {
       type = 'function',
       type = 'function',
       arguments = {},
       arguments = {},
       returns = {},
       returns = {},
       description = 'The iterator function, usable in a for loop.'
       description = 'The iterator function, usable in a for loop.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'iterator' }
+    }
   }
   }
 }
 }

+ 6 - 0
api/lovr/event/pump.lua

@@ -7,6 +7,12 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   related = {
   related = {
     'lovr.event.poll'
     'lovr.event.poll'
   }
   }

+ 7 - 2
api/lovr/event/push.lua

@@ -6,8 +6,7 @@ return {
     `lovr.handlers` table with a key that's the same as the event name.
     `lovr.handlers` table with a key that's the same as the event name.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       type = 'string',
       description = 'The name of the event.'
       description = 'The name of the event.'
     },
     },
@@ -18,6 +17,12 @@ return {
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'name' },
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     Only nil, booleans, numbers, strings, and LÖVR objects are supported types for event data.
     Only nil, booleans, numbers, strings, and LÖVR objects are supported types for event data.
   ]],
   ]],

+ 7 - 2
api/lovr/event/quit.lua

@@ -6,14 +6,19 @@ return {
     indicates that an error occurred.
     indicates that an error occurred.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'code',
+    code = {
       type = 'number',
       type = 'number',
       default = '0',
       default = '0',
       description = 'The exit code of the program.'
       description = 'The exit code of the program.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'code' },
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     This function is equivalent to calling `lovr.event.push('quit', <args>)`.
     This function is equivalent to calling `lovr.event.push('quit', <args>)`.
 
 

+ 6 - 0
api/lovr/event/restart.lua

@@ -3,6 +3,12 @@ return {
   description = 'Pushes an event to restart the framework.',
   description = 'Pushes an event to restart the framework.',
   arguments = {},
   arguments = {},
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     The event won't be processed until the next time `lovr.event.poll` is called.
     The event won't be processed until the next time `lovr.event.poll` is called.
 
 

+ 8 - 4
api/lovr/filesystem/createDirectory.lua

@@ -5,17 +5,21 @@ return {
     created.
     created.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The directory to create, recursively.'
       description = 'The directory to create, recursively.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the directory was created.'
       description = 'Whether the directory was created.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'success' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/filesystem/getAppdataDirectory.lua

@@ -9,10 +9,15 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The absolute path to the appdata directory.'
       description = 'The absolute path to the appdata directory.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
   }
 }
 }

+ 8 - 4
api/lovr/filesystem/getDirectoryItems.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get a list of files in a directory.',
   summary = 'Get a list of files in a directory.',
   description = 'Returns a sorted table containing all files and folders in a single directory.',
   description = 'Returns a sorted table containing all files and folders in a single directory.',
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The directory.'
       description = 'The directory.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'table',
+    table = {
       type = 'items',
       type = 'items',
       description = 'A table with a string for each file and subfolder in the directory.'
       description = 'A table with a string for each file and subfolder in the directory.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'table' }
+    }
+  },
   notes = [[
   notes = [[
     This function calls `table.sort` to sort the results, so if `table.sort` is not available in the
     This function calls `table.sort` to sort the results, so if `table.sort` is not available in the
     global scope the results are not guaranteed to be sorted.
     global scope the results are not guaranteed to be sorted.

+ 7 - 2
api/lovr/filesystem/getExecutablePath.lua

@@ -3,10 +3,15 @@ return {
   description = 'Returns the absolute path of the LÖVR executable.',
   description = 'Returns the absolute path of the LÖVR executable.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The absolute path of the LÖVR executable, or `nil` if it is unknown.'
       description = 'The absolute path of the LÖVR executable, or `nil` if it is unknown.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/filesystem/getIdentity.lua

@@ -6,12 +6,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'identity',
+    identity = {
       type = 'string',
       type = 'string',
       description = 'The name of the save directory, or `nil` if it isn\'t set.'
       description = 'The name of the save directory, or `nil` if it isn\'t set.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'identity' }
+    }
+  },
   notes = [[
   notes = [[
     On Android, this is always the package id (like `org.lovr.app`).
     On Android, this is always the package id (like `org.lovr.app`).
   ]]
   ]]

+ 8 - 4
api/lovr/filesystem/getLastModified.lua

@@ -2,17 +2,21 @@ return {
   summary = 'Get the modification time of a file.',
   summary = 'Get the modification time of a file.',
   description = 'Returns when a file was last modified, since some arbitrary time in the past.',
   description = 'Returns when a file was last modified, since some arbitrary time in the past.',
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The file to check.'
       description = 'The file to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'time',
+    time = {
       type = 'number',
       type = 'number',
       description = 'The modification time of the file, in seconds, or `nil` if it\'s unknown.'
       description = 'The modification time of the file, in seconds, or `nil` if it\'s unknown.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'time' }
+    }
   }
   }
 }
 }

+ 8 - 4
api/lovr/filesystem/getRealDirectory.lua

@@ -5,17 +5,21 @@ return {
     can be used to determine if a file is in the game's source directory or the save directory.
     can be used to determine if a file is in the game's source directory or the save directory.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The path to check.'
       description = 'The path to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'realpath',
+    realpath = {
       type = 'string',
       type = 'string',
       description = 'The absolute path of the mounted archive containing `path`.'
       description = 'The absolute path of the mounted archive containing `path`.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'realpath' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/filesystem/getRequirePath.lua

@@ -8,11 +8,16 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The semicolon separated list of search patterns.'
       description = 'The semicolon separated list of search patterns.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
+  },
   notes = ' The default reqiure path is \'?.lua;?/init.lua\'.'
   notes = ' The default reqiure path is \'?.lua;?/init.lua\'.'
 }
 }

+ 7 - 2
api/lovr/filesystem/getSaveDirectory.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the absolute path to the save directory.',
   description = 'Returns the absolute path to the save directory.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The absolute path to the save directory.'
       description = 'The absolute path to the save directory.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
+  },
   notes = [[
   notes = [[
     The save directory takes the following form:
     The save directory takes the following form:
 
 

+ 8 - 4
api/lovr/filesystem/getSize.lua

@@ -2,18 +2,22 @@ return {
   summary = 'Get the size of a file.',
   summary = 'Get the size of a file.',
   description = 'Returns the size of a file, in bytes.',
   description = 'Returns the size of a file, in bytes.',
   arguments = {
   arguments = {
-    {
-      name = 'file',
+    file = {
       type = 'string',
       type = 'string',
       description = 'The file.'
       description = 'The file.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'size',
+    size = {
       type = 'number',
       type = 'number',
       description = 'The size of the file, in bytes.'
       description = 'The size of the file, in bytes.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'file' },
+      returns = { 'size' }
+    }
+  },
   notes = 'If the file does not exist, an error is thrown.'
   notes = 'If the file does not exist, an error is thrown.'
 }
 }

+ 7 - 2
api/lovr/filesystem/getSource.lua

@@ -3,10 +3,15 @@ return {
   description = 'Get the absolute path of the project\'s source directory or archive.',
   description = 'Get the absolute path of the project\'s source directory or archive.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The absolute path of the project\'s source, or `nil` if it\'s unknown.'
       description = 'The absolute path of the project\'s source, or `nil` if it\'s unknown.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/filesystem/getUserDirectory.lua

@@ -3,10 +3,15 @@ return {
   description = 'Returns the absolute path of the user\'s home directory.',
   description = 'Returns the absolute path of the user\'s home directory.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The absolute path of the user\'s home directory.'
       description = 'The absolute path of the user\'s home directory.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/filesystem/getWorkingDirectory.lua

@@ -6,10 +6,15 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The current working directory, or `nil` if it\'s unknown.'
       description = 'The current working directory, or `nil` if it\'s unknown.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
   }
 }
 }

+ 8 - 4
api/lovr/filesystem/isDirectory.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Check whether a path is a directory.',
   summary = 'Check whether a path is a directory.',
   description = 'Check if a path exists and is a directory.',
   description = 'Check if a path exists and is a directory.',
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The path to check.'
       description = 'The path to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'isDirectory',
+    isDirectory = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether or not the path is a directory.'
       description = 'Whether or not the path is a directory.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'isDirectory' }
+    }
+  },
   related = {
   related = {
     'lovr.filesystem.isFile'
     'lovr.filesystem.isFile'
   }
   }

+ 8 - 4
api/lovr/filesystem/isFile.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Check whether a path is a file.',
   summary = 'Check whether a path is a file.',
   description = 'Check if a path exists and is a file.',
   description = 'Check if a path exists and is a file.',
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The path to check.'
       description = 'The path to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'isFile',
+    isFile = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether or not the path is a file.'
       description = 'Whether or not the path is a file.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'isFile' }
+    }
+  },
   related = {
   related = {
     'lovr.filesystem.isDirectory'
     'lovr.filesystem.isDirectory'
   }
   }

+ 7 - 2
api/lovr/filesystem/isFused.lua

@@ -3,10 +3,15 @@ return {
   description = 'Returns whether the current project source is fused to the executable.',
   description = 'Returns whether the current project source is fused to the executable.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'fused',
+    fused = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether or not the project is fused.'
       description = 'Whether or not the project is fused.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'fused' }
+    }
   }
   }
 }
 }

+ 8 - 4
api/lovr/filesystem/load.lua

@@ -2,15 +2,13 @@ return {
   summary = 'Load a file as Lua code.',
   summary = 'Load a file as Lua code.',
   description = 'Load a file containing Lua code, returning a Lua chunk that can be run.',
   description = 'Load a file containing Lua code, returning a Lua chunk that can be run.',
   arguments = {
   arguments = {
-    {
-      name = 'filename',
+    filename = {
       type = 'string',
       type = 'string',
       description = 'The file to load.'
       description = 'The file to load.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'chunk',
+    chunk = {
       type = 'function',
       type = 'function',
       arguments = {
       arguments = {
         {
         {
@@ -27,6 +25,12 @@ return {
       description = 'The runnable chunk.'
       description = 'The runnable chunk.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'filename' },
+      returns = { 'chunk' }
+    }
+  },
   notes = 'An error is thrown if the file contains syntax errors.',
   notes = 'An error is thrown if the file contains syntax errors.',
   example = {
   example = {
     description = 'Safely loading code:',
     description = 'Safely loading code:',

+ 11 - 10
api/lovr/filesystem/mount.lua

@@ -5,27 +5,23 @@ return {
     allows you to read files from it.
     allows you to read files from it.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The path to mount.'
       description = 'The path to mount.'
     },
     },
-    {
-      name = 'mountpoint',
+    mountpoint = {
       type = 'string',
       type = 'string',
       default = [['/']],
       default = [['/']],
       description = 'The path in the virtual filesystem to mount to.'
       description = 'The path in the virtual filesystem to mount to.'
     },
     },
-    {
-      name = 'append',
+    append = {
       type = 'boolean',
       type = 'boolean',
       default = 'false',
       default = 'false',
       description = [[
       description = [[
         Whether the archive will be added to the end or the beginning of the search path.
         Whether the archive will be added to the end or the beginning of the search path.
       ]]
       ]]
     },
     },
-    {
-      name = 'root',
+    root = {
       type = 'string',
       type = 'string',
       default = 'nil',
       default = 'nil',
       description = [[
       description = [[
@@ -35,12 +31,17 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the archive was successfully mounted.'
       description = 'Whether the archive was successfully mounted.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'path', 'mountpoint', 'append', 'root' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
   notes = [[
     The `append` option lets you control the priority of the archive's files in the event of naming
     The `append` option lets you control the priority of the archive's files in the event of naming
     collisions.
     collisions.

+ 8 - 4
api/lovr/filesystem/newBlob.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Create a new Blob from a file.',
   summary = 'Create a new Blob from a file.',
   description = 'Creates a new Blob that contains the contents of a file.',
   description = 'Creates a new Blob that contains the contents of a file.',
   arguments = {
   arguments = {
-    {
-      name = 'filename',
+    filename = {
       type = 'string',
       type = 'string',
       description = 'The file to load.'
       description = 'The file to load.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       type = 'Blob',
       description = 'The new Blob.'
       description = 'The new Blob.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'filename' },
+      returns = { 'blob' }
+    }
+  },
   related = {
   related = {
     'lovr.data.newBlob',
     'lovr.data.newBlob',
     'Blob'
     'Blob'

+ 10 - 8
api/lovr/filesystem/read.lua

@@ -2,29 +2,31 @@ return {
   summary = 'Read a file.',
   summary = 'Read a file.',
   description = 'Read the contents of a file.',
   description = 'Read the contents of a file.',
   arguments = {
   arguments = {
-    {
-      name = 'filename',
+    filename = {
       type = 'string',
       type = 'string',
       description = 'The name of the file to read.'
       description = 'The name of the file to read.'
     },
     },
-    {
-      name = 'bytes',
+    bytes = {
       type = 'number',
       type = 'number',
       default = '-1',
       default = '-1',
       description = 'The number of bytes to read (if -1, all bytes will be read).'
       description = 'The number of bytes to read (if -1, all bytes will be read).'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'contents',
+    contents = {
       type = 'string',
       type = 'string',
       description = 'The contents of the file.'
       description = 'The contents of the file.'
     },
     },
-    {
-      name = 'bytes',
+    bytes = {
       type = 'number',
       type = 'number',
       description = 'The number of bytes read from the file.'
       description = 'The number of bytes read from the file.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'filename', 'bytes' },
+      returns = { 'contents', 'bytes' }
+    }
+  },
   notes = 'If the file does not exist or cannot be read, nil is returned.'
   notes = 'If the file does not exist or cannot be read, nil is returned.'
 }
 }

+ 8 - 4
api/lovr/filesystem/remove.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Remove a file or directory.',
   summary = 'Remove a file or directory.',
   description = 'Remove a file or directory in the save directory.',
   description = 'Remove a file or directory in the save directory.',
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The file or directory to remove.'
       description = 'The file or directory to remove.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the path was removed.'
       description = 'Whether the path was removed.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
   notes = [[
     A directory can only be removed if it is empty.
     A directory can only be removed if it is empty.
 
 

+ 8 - 3
api/lovr/filesystem/setIdentity.lua

@@ -2,11 +2,16 @@ return {
   summary = 'Set the name of the save directory.',
   summary = 'Set the name of the save directory.',
   description = 'Set the name of the save directory.',
   description = 'Set the name of the save directory.',
   arguments = {
   arguments = {
-    {
-      name = 'identity',
+    identity = {
       type = 'string',
       type = 'string',
       description = 'The new name of the save directory.'
       description = 'The new name of the save directory.'
     }
     }
   },
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'identity' },
+      returns = {}
+    }
+  }
 }
 }

+ 7 - 2
api/lovr/filesystem/setRequirePath.lua

@@ -8,13 +8,18 @@ return {
     the project directory.
     the project directory.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       default = 'nil',
       default = 'nil',
       description = 'An optional semicolon separated list of search patterns.'
       description = 'An optional semicolon separated list of search patterns.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = {}
+    }
+  },
   notes = 'The default reqiure path is \'?.lua;?/init.lua\'.'
   notes = 'The default reqiure path is \'?.lua;?/init.lua\'.'
 }
 }

+ 8 - 3
api/lovr/filesystem/setSource.lua

@@ -5,11 +5,16 @@ return {
     internally.
     internally.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'identity',
+    identity = {
       type = 'string',
       type = 'string',
       description = 'The path containing the project\'s source.'
       description = 'The path containing the project\'s source.'
     }
     }
   },
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'identity' },
+      returns = {}
+    }
+  }
 }
 }

+ 8 - 4
api/lovr/filesystem/unmount.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Unmount a mounted archive.',
   summary = 'Unmount a mounted archive.',
   description = 'Unmounts a directory or archive previously mounted with `lovr.filesystem.mount`.',
   description = 'Unmounts a directory or archive previously mounted with `lovr.filesystem.mount`.',
   arguments = {
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       type = 'string',
       description = 'The path to unmount.'
       description = 'The path to unmount.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the archive was unmounted.'
       description = 'Whether the archive was unmounted.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
   notes = [[
     This function is not thread safe.  Mounting or unmounting an archive while other threads call
     This function is not thread safe.  Mounting or unmounting an archive while other threads call
     lovr.filesystem functions is not supported.
     lovr.filesystem functions is not supported.

+ 10 - 8
api/lovr/graphics/getBackgroundColor.lua

@@ -4,26 +4,28 @@ return {
   description = 'TODO',
   description = 'TODO',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'r',
+    r = {
       type = 'number',
       type = 'number',
       description = 'The red component of the background color.',
       description = 'The red component of the background color.',
     },
     },
-    {
-      name = 'g',
+    g = {
       type = 'number',
       type = 'number',
       description = 'The green component of the background color.',
       description = 'The green component of the background color.',
     },
     },
-    {
-      name = 'b',
+    b = {
       type = 'number',
       type = 'number',
       description = 'The blue component of the background color.',
       description = 'The blue component of the background color.',
     },
     },
-    {
-      name = 'a',
+    a = {
       type = 'number',
       type = 'number',
       description = 'The alpha component of the background color.',
       description = 'The alpha component of the background color.',
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'r', 'g', 'b', 'a' }
+    }
+  },
   notes = 'TODO'
   notes = 'TODO'
 }
 }

+ 7 - 2
api/lovr/graphics/getDefaultFont.lua

@@ -6,12 +6,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'font',
+    font = {
       type = 'Font',
       type = 'Font',
       description = 'The default Font object.'
       description = 'The default Font object.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'font' }
+    }
+  },
   related = {
   related = {
     'Pass:text',
     'Pass:text',
     'lovr.graphics.newFont'
     'lovr.graphics.newFont'

+ 7 - 2
api/lovr/graphics/getDevice.lua

@@ -4,8 +4,7 @@ return {
   description = 'Returns information about the graphics device and driver.',
   description = 'Returns information about the graphics device and driver.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'device',
+    device = {
       type = 'table',
       type = 'table',
       table = {
       table = {
         {
         {
@@ -45,6 +44,12 @@ return {
       }
       }
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'device' }
+    }
+  },
   notes = [[
   notes = [[
     The device and vendor ID numbers will usually be PCI IDs, which are standardized numbers
     The device and vendor ID numbers will usually be PCI IDs, which are standardized numbers
     consisting of 4 hex digits.  Various online databases and system utilities can be used to look
     consisting of 4 hex digits.  Various online databases and system utilities can be used to look

+ 7 - 2
api/lovr/graphics/getFeatures.lua

@@ -4,8 +4,7 @@ return {
   description = 'Returns a table indicating which features are supported by the GPU.',
   description = 'Returns a table indicating which features are supported by the GPU.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'features',
+    features = {
       type = 'table',
       type = 'table',
       description = '',
       description = '',
       table = {
       table = {
@@ -66,6 +65,12 @@ return {
       }
       }
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'features' }
+    }
+  },
   related = {
   related = {
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.getDevice',
     'lovr.graphics.getDevice',

+ 7 - 2
api/lovr/graphics/getLimits.lua

@@ -4,8 +4,7 @@ return {
   description = 'Returns limits of the current GPU.',
   description = 'Returns limits of the current GPU.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'limits',
+    limits = {
       type = 'table',
       type = 'table',
       description = '',
       description = '',
       table = {
       table = {
@@ -191,6 +190,12 @@ return {
       }
       }
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'limits' }
+    }
+  },
   notes = [[
   notes = [[
     The limit ranges are as follows:
     The limit ranges are as follows:
 
 

+ 7 - 2
api/lovr/graphics/getStats.lua

@@ -4,8 +4,7 @@ return {
   description = 'TODO',
   description = 'TODO',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'stats',
+    stats = {
       type = 'table',
       type = 'table',
       description = 'Graphics statistics.',
       description = 'Graphics statistics.',
       table = {
       table = {
@@ -150,6 +149,12 @@ return {
       }
       }
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'stats' }
+    }
+  },
   related = {
   related = {
     'lovr.graphics.getDevice',
     'lovr.graphics.getDevice',
     'lovr.graphics.getFeatures',
     'lovr.graphics.getFeatures',

+ 7 - 2
api/lovr/graphics/getWindowPass.lua

@@ -7,12 +7,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'pass',
+    pass = {
       type = 'Pass',
       type = 'Pass',
       description = 'The window pass, or `nil` if there is no window.'
       description = 'The window pass, or `nil` if there is no window.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'pass' }
+    }
+  },
   notes = [[
   notes = [[
     - TODO is the same pass always returned
     - TODO is the same pass always returned
     - TODO does the texture change
     - TODO does the texture change

+ 8 - 4
api/lovr/graphics/isFormatSupported.lua

@@ -3,8 +3,7 @@ return {
   summary = 'Check if a Texture format is supported.',
   summary = 'Check if a Texture format is supported.',
   description = 'TODO',
   description = 'TODO',
   arguments = {
   arguments = {
-    {
-      name = 'format',
+    format = {
       type = 'TextureFormat',
       type = 'TextureFormat',
       description = 'TODO'
       description = 'TODO'
     },
     },
@@ -15,12 +14,17 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'supported',
+    supported = {
       type = 'boolean',
       type = 'boolean',
       description = 'TODO'
       description = 'TODO'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'format' },
+      returns = { 'supported' }
+    }
+  },
   related = {
   related = {
     'lovr.graphics.getDevice',
     'lovr.graphics.getDevice',
     'lovr.graphics.getFeatures',
     'lovr.graphics.getFeatures',

+ 8 - 4
api/lovr/graphics/newSampler.lua

@@ -3,8 +3,7 @@ return {
   summary = 'Create a new Sampler.',
   summary = 'Create a new Sampler.',
   description = 'TODO',
   description = 'TODO',
   arguments = {
   arguments = {
-    {
-      name = 'options',
+    options = {
       type = 'table',
       type = 'table',
       description = 'TODO',
       description = 'TODO',
       table = {
       table = {
@@ -37,12 +36,17 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'sampler',
+    sampler = {
       type = 'Sampler',
       type = 'Sampler',
       description = 'TODO'
       description = 'TODO'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'options' },
+      returns = { 'sampler' }
+    }
+  },
   related = {
   related = {
     'Pass:setSampler'
     'Pass:setSampler'
   }
   }

+ 10 - 8
api/lovr/graphics/newTally.lua

@@ -3,18 +3,15 @@ return {
   summary = 'Create a new Tally.',
   summary = 'Create a new Tally.',
   description = 'TODO',
   description = 'TODO',
   arguments = {
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'TallyType',
       type = 'TallyType',
       description = 'The type of the Tally, which controls what "thing" it measures.'
       description = 'The type of the Tally, which controls what "thing" it measures.'
     },
     },
-    {
-      name = 'count',
+    count = {
       type = 'number',
       type = 'number',
       description = 'The number of slots in the Tally.  Each slot performs one measurement.'
       description = 'The number of slots in the Tally.  Each slot performs one measurement.'
     },
     },
-    {
-      name = 'views',
+    views = {
       type = 'number',
       type = 'number',
       default = '2',
       default = '2',
       description = [[
       description = [[
@@ -24,12 +21,17 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'tally',
+    tally = {
       type = 'Tally',
       type = 'Tally',
       description = 'The new Tally.'
       description = 'The new Tally.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'type', 'count', 'views' },
+      returns = { 'tally' }
+    }
+  },
   related = {
   related = {
     'Pass:tick',
     'Pass:tick',
     'Pass:tock'
     'Pass:tock'

+ 6 - 0
api/lovr/graphics/present.lua

@@ -7,6 +7,12 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     This should be called after submitting the window pass (`lovr.graphics.getWindowPass`).  If the
     This should be called after submitting the window pass (`lovr.graphics.getWindowPass`).  If the
     window texture has not been rendered to since the last present, this function does nothing.
     window texture has not been rendered to since the last present, this function does nothing.

+ 6 - 0
api/lovr/graphics/wait.lua

@@ -4,6 +4,12 @@ return {
   description = 'TODO',
   description = 'TODO',
   arguments = {},
   arguments = {},
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   related = {
   related = {
     'lovr.graphics.submit'
     'lovr.graphics.submit'
   }
   }

+ 9 - 6
api/lovr/headset/animate.lua

@@ -9,21 +9,18 @@ return {
     `true`.
     `true`.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to use for the animation data.'
       description = 'The device to use for the animation data.'
     },
     },
-    {
-      name = 'model',
+    model = {
       type = 'Model',
       type = 'Model',
       description = 'The model to animate.'
       description = 'The model to animate.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = [[
       description = [[
         Whether the animation was applied successfully to the Model.  If the Model was not
         Whether the animation was applied successfully to the Model.  If the Model was not
@@ -31,6 +28,12 @@ return {
       ]]
       ]]
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'model' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
   notes = [[
     Currently this function is supported for OpenVR controller models and Oculus hand models.
     Currently this function is supported for OpenVR controller models and Oculus hand models.
 
 

+ 10 - 8
api/lovr/headset/getAngularVelocity.lua

@@ -3,30 +3,32 @@ return {
   summary = 'Get the angular velocity of a device.',
   summary = 'Get the angular velocity of a device.',
   description = 'Returns the current angular velocity of a device.',
   description = 'Returns the current angular velocity of a device.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to get the velocity of.'
       description = 'The device to get the velocity of.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x component of the angular velocity.'
       description = 'The x component of the angular velocity.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y component of the angular velocity.'
       description = 'The y component of the angular velocity.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z component of the angular velocity.'
       description = 'The z component of the angular velocity.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'x', 'y', 'z' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getVelocity',
     'lovr.headset.getVelocity',
     'lovr.headset.getPosition',
     'lovr.headset.getPosition',

+ 8 - 4
api/lovr/headset/getAxis.lua

@@ -8,13 +8,11 @@ return {
     the `select` function built in to Lua to select a particular axis component.
     the `select` function built in to Lua to select a particular axis component.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       description = 'The device.'
       description = 'The device.'
     },
     },
-    {
-      name = 'axis',
+    axis = {
       type = 'DeviceAxis',
       type = 'DeviceAxis',
       description = 'The axis.'
       description = 'The axis.'
     }
     }
@@ -29,6 +27,12 @@ return {
       ]]
       ]]
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'axis' },
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     The axis values will be between 0 and 1 for 1D axes, and between -1 and 1 for each component of
     The axis values will be between 0 and 1 for 1D axes, and between -1 and 1 for each component of
     a multidimensional axis.
     a multidimensional axis.

+ 7 - 2
api/lovr/headset/getBoundsDepth.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the depth of the play area, in meters.',
   description = 'Returns the depth of the play area, in meters.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'depth',
+    depth = {
       type = 'number',
       type = 'number',
       description = 'The depth of the play area, in meters.'
       description = 'The depth of the play area, in meters.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'depth' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsDimensions'
     'lovr.headset.getBoundsDimensions'

+ 8 - 4
api/lovr/headset/getBoundsDimensions.lua

@@ -4,17 +4,21 @@ return {
   description = 'Returns the size of the play area, in meters.',
   description = 'Returns the size of the play area, in meters.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       type = 'number',
       description = 'The width of the play area, in meters.'
       description = 'The width of the play area, in meters.'
     },
     },
-    {
-      name = 'depth',
+    depth = {
       type = 'number',
       type = 'number',
       description = 'The depth of the play area, in meters.'
       description = 'The depth of the play area, in meters.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width', 'depth' }
+    }
+  },
   notes = [[
   notes = [[
     This currently returns 0 on the Quest.
     This currently returns 0 on the Quest.
   ]],
   ]],

+ 8 - 4
api/lovr/headset/getBoundsGeometry.lua

@@ -6,20 +6,24 @@ return {
     headset driver does not expose this information.
     headset driver does not expose this information.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 't',
+    t = {
       type = 'table',
       type = 'table',
       default = 'nil',
       default = 'nil',
       description = 'A table to fill with the points.  If `nil`, a new table will be created.'
       description = 'A table to fill with the points.  If `nil`, a new table will be created.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'points',
+    points = {
       type = 'table',
       type = 'table',
       description = 'A flat table of 3D points representing the play area boundaries.'
       description = 'A flat table of 3D points representing the play area boundaries.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 't' },
+      returns = { 'points' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getBoundsDimensions'
     'lovr.headset.getBoundsDimensions'
   }
   }

+ 7 - 2
api/lovr/headset/getBoundsWidth.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the width of the play area, in meters.',
   description = 'Returns the width of the play area, in meters.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       type = 'number',
       description = 'The width of the play area, in meters.'
       description = 'The width of the play area, in meters.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getBoundsDepth',
     'lovr.headset.getBoundsDepth',
     'lovr.headset.getBoundsDimensions'
     'lovr.headset.getBoundsDimensions'

+ 8 - 4
api/lovr/headset/getClipDistance.lua

@@ -7,17 +7,21 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'near',
+    near = {
       type = 'number',
       type = 'number',
       description = 'The distance to the near clipping plane, in meters.'
       description = 'The distance to the near clipping plane, in meters.'
     },
     },
-    {
-      name = 'far',
+    far = {
       type = 'number',
       type = 'number',
       description = 'The distance to the far clipping plane, in meters.'
       description = 'The distance to the far clipping plane, in meters.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'near', 'far' }
+    }
+  },
   notes = [[
   notes = [[
     The default near and far clipping planes are 0.1 meters and 100.0 meters.
     The default near and far clipping planes are 0.1 meters and 100.0 meters.
 
 

+ 8 - 4
api/lovr/headset/getDisplayDimensions.lua

@@ -4,17 +4,21 @@ return {
   description = 'Returns the texture dimensions of the headset display (for one eye), in pixels.',
   description = 'Returns the texture dimensions of the headset display (for one eye), in pixels.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       type = 'number',
       description = 'The width of the display.'
       description = 'The width of the display.'
     },
     },
-    {
-      name = 'height',
+    height = {
       type = 'number',
       type = 'number',
       description = 'The height of the display.'
       description = 'The height of the display.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width', 'height' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getDisplayWidth',
     'lovr.headset.getDisplayWidth',
     'lovr.headset.getDisplayHeight'
     'lovr.headset.getDisplayHeight'

+ 7 - 2
api/lovr/headset/getDisplayFrequencies.lua

@@ -6,14 +6,19 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'frequencies',
+    frequencies = {
       type = 'table',
       type = 'table',
       description = [[
       description = [[
         A flat table of the refresh rates supported by the headset display, nil if not supported.
         A flat table of the refresh rates supported by the headset display, nil if not supported.
       ]]
       ]]
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'frequencies' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.setDisplayFrequency'
     'lovr.headset.setDisplayFrequency'
   }
   }

+ 7 - 2
api/lovr/headset/getDisplayFrequency.lua

@@ -4,10 +4,15 @@ return {
   description = 'Returns the refresh rate of the headset display, in Hz.',
   description = 'Returns the refresh rate of the headset display, in Hz.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       type = 'number',
       description = 'The frequency of the display, or `nil` if I have no idea what it is.'
       description = 'The frequency of the display, or `nil` if I have no idea what it is.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'frequency' }
+    }
   }
   }
 }
 }

+ 7 - 2
api/lovr/headset/getDisplayHeight.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the height of the headset display (for one eye), in pixels.',
   description = 'Returns the height of the headset display (for one eye), in pixels.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       type = 'number',
       description = 'The height of the display.'
       description = 'The height of the display.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getDisplayWidth',
     'lovr.headset.getDisplayWidth',
     'lovr.headset.getDisplayDimensions'
     'lovr.headset.getDisplayDimensions'

+ 7 - 2
api/lovr/headset/getDisplayMask.lua

@@ -10,12 +10,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'points',
+    points = {
       type = 'table',
       type = 'table',
       description = 'A table of points.  Each point is a table with two numbers between 0 and 1.'
       description = 'A table of points.  Each point is a table with two numbers between 0 and 1.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'points' }
+    }
+  },
   example = [=[
   example = [=[
     function lovr.load()
     function lovr.load()
       lovr.graphics.setBackgroundColor(1, 1, 1)
       lovr.graphics.setBackgroundColor(1, 1, 1)

+ 7 - 2
api/lovr/headset/getDisplayWidth.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the width of the headset display (for one eye), in pixels.',
   description = 'Returns the width of the headset display (for one eye), in pixels.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       type = 'number',
       description = 'The width of the display.'
       description = 'The width of the display.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getDisplayHeight',
     'lovr.headset.getDisplayHeight',
     'lovr.headset.getDisplayDimensions'
     'lovr.headset.getDisplayDimensions'

+ 7 - 2
api/lovr/headset/getHands.lua

@@ -4,14 +4,19 @@ return {
   description = 'Returns a table with all of the currently tracked hand devices.',
   description = 'Returns a table with all of the currently tracked hand devices.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'hands',
+    hands = {
       type = 'table',
       type = 'table',
       arguments = {},
       arguments = {},
       returns = {},
       returns = {},
       description = 'The currently tracked hand devices.'
       description = 'The currently tracked hand devices.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'hands' }
+    }
+  },
   notes = 'The hand paths will *always* be either `hand/left` or `hand/right`.',
   notes = 'The hand paths will *always* be either `hand/left` or `hand/right`.',
   example = [[
   example = [[
     function lovr.update(dt)
     function lovr.update(dt)

+ 7 - 2
api/lovr/headset/getMirrorTexture.lua

@@ -13,12 +13,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'mirror',
+    mirror = {
       type = 'Texture',
       type = 'Texture',
       description = 'The mirror texture.'
       description = 'The mirror texture.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'mirror' }
+    }
+  },
   related = {
   related = {
     'lovr.mirror'
     'lovr.mirror'
   }
   }

+ 7 - 2
api/lovr/headset/getName.lua

@@ -7,12 +7,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       type = 'string',
       description = 'The name of the headset as a string.'
       description = 'The name of the headset as a string.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'name' }
+    }
+  },
   notes = [[
   notes = [[
     <table>
     <table>
       <thead>
       <thead>

+ 11 - 10
api/lovr/headset/getOrientation.lua

@@ -3,35 +3,36 @@ return {
   summary = 'Get the orientation of a device.',
   summary = 'Get the orientation of a device.',
   description = 'Returns the current orientation of a device, in angle/axis form.',
   description = 'Returns the current orientation of a device, in angle/axis form.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to get the orientation of.'
       description = 'The device to get the orientation of.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The amount of rotation around the axis of rotation, in radians.'
       description = 'The amount of rotation around the axis of rotation, in radians.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   notes = ' If the device isn\'t tracked, all zeroes will be returned.',
   notes = ' If the device isn\'t tracked, all zeroes will be returned.',
   related = {
   related = {
     'lovr.headset.getPose',
     'lovr.headset.getPose',

+ 7 - 2
api/lovr/headset/getOriginType.lua

@@ -7,12 +7,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'origin',
+    origin = {
       type = 'HeadsetOrigin',
       type = 'HeadsetOrigin',
       description = 'The type of origin.'
       description = 'The type of origin.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'origin' }
+    }
+  },
   related = {
   related = {
     'HeadsetOrigin'
     'HeadsetOrigin'
   }
   }

+ 7 - 2
api/lovr/headset/getPass.lua

@@ -3,12 +3,17 @@ return {
   description = 'TODO',
   description = 'TODO',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'pass',
+    pass = {
       type = 'Pass',
       type = 'Pass',
       description = 'The Pass.'
       description = 'The Pass.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'pass' }
+    }
+  },
   related = {
   related = {
     'lovr.graphics.getPass',
     'lovr.graphics.getPass',
     'lovr.conf'
     'lovr.conf'

+ 14 - 16
api/lovr/headset/getPose.lua

@@ -3,50 +3,48 @@ return {
   summary = 'Get the pose of a device.',
   summary = 'Get the pose of a device.',
   description = 'Returns the current position and orientation of a device.',
   description = 'Returns the current position and orientation of a device.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to get the pose of.'
       description = 'The device to get the pose of.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x position.'
       description = 'The x position.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y position.'
       description = 'The y position.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z position.'
       description = 'The z position.'
     },
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The amount of rotation around the axis of rotation, in radians.'
       description = 'The amount of rotation around the axis of rotation, in radians.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   notes = [[
   notes = [[
     Units are in meters.
     Units are in meters.
 
 

+ 10 - 8
api/lovr/headset/getPosition.lua

@@ -3,30 +3,32 @@ return {
   summary = 'Get the position of a device.',
   summary = 'Get the position of a device.',
   description = 'Returns the current position of a device, in meters, relative to the play area.',
   description = 'Returns the current position of a device, in meters, relative to the play area.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to get the position of.'
       description = 'The device to get the position of.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x position of the device.'
       description = 'The x position of the device.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y position of the device.'
       description = 'The y position of the device.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z position of the device.'
       description = 'The z position of the device.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'x', 'y', 'z' }
+    }
+  },
   notes = ' If the device isn\'t tracked, all zeroes will be returned.',
   notes = ' If the device isn\'t tracked, all zeroes will be returned.',
   related = {
   related = {
     'lovr.headset.getPose',
     'lovr.headset.getPose',

+ 7 - 2
api/lovr/headset/getTime.lua

@@ -9,12 +9,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'time',
+    time = {
       type = 'number',
       type = 'number',
       description = 'The predicted display time, in seconds.'
       description = 'The predicted display time, in seconds.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'time' }
+    }
+  },
   notes = [[
   notes = [[
     This has a different epoch than `lovr.timer.getTime`, so it is not guaranteed to be close to
     This has a different epoch than `lovr.timer.getTime`, so it is not guaranteed to be close to
     that value.
     that value.

+ 10 - 8
api/lovr/headset/getVelocity.lua

@@ -3,30 +3,32 @@ return {
   summary = 'Get the linear velocity of a device.',
   summary = 'Get the linear velocity of a device.',
   description = 'Returns the current linear velocity of a device, in meters per second.',
   description = 'Returns the current linear velocity of a device, in meters per second.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to get the velocity of.'
       description = 'The device to get the velocity of.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'vx',
+    vx = {
       type = 'number',
       type = 'number',
       description = 'The x component of the linear velocity.'
       description = 'The x component of the linear velocity.'
     },
     },
-    {
-      name = 'vy',
+    vy = {
       type = 'number',
       type = 'number',
       description = 'The y component of the linear velocity.'
       description = 'The y component of the linear velocity.'
     },
     },
-    {
-      name = 'vz',
+    vz = {
       type = 'number',
       type = 'number',
       description = 'The z component of the linear velocity.'
       description = 'The z component of the linear velocity.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'vx', 'vy', 'vz' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getAngularVelocity',
     'lovr.headset.getAngularVelocity',
     'lovr.headset.getPose',
     'lovr.headset.getPose',

+ 11 - 10
api/lovr/headset/getViewAngles.lua

@@ -9,34 +9,35 @@ return {
     If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
     If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'view',
+    view = {
       type = 'number',
       type = 'number',
       description = 'The view index.'
       description = 'The view index.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'left',
+    left = {
       type = 'number',
       type = 'number',
       description = 'The left view angle, in radians.'
       description = 'The left view angle, in radians.'
     },
     },
-    {
-      name = 'right',
+    right = {
       type = 'number',
       type = 'number',
       description = 'The right view angle, in radians.'
       description = 'The right view angle, in radians.'
     },
     },
-    {
-      name = 'top',
+    top = {
       type = 'number',
       type = 'number',
       description = 'The top view angle, in radians.'
       description = 'The top view angle, in radians.'
     },
     },
-    {
-      name = 'bottom',
+    bottom = {
       type = 'number',
       type = 'number',
       description = 'The bottom view angle, in radians.'
       description = 'The bottom view angle, in radians.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'view' },
+      returns = { 'left', 'right', 'top', 'bottom' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getViewCount',
     'lovr.headset.getViewCount',
     'lovr.headset.getViewPose'
     'lovr.headset.getViewPose'

+ 7 - 2
api/lovr/headset/getViewCount.lua

@@ -11,12 +11,17 @@ return {
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       type = 'number',
       description = 'The number of views.'
       description = 'The number of views.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getViewPose',
     'lovr.headset.getViewPose',
     'lovr.headset.getViewAngles'
     'lovr.headset.getViewAngles'

+ 14 - 16
api/lovr/headset/getViewPose.lua

@@ -8,49 +8,47 @@ return {
     If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
     If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'view',
+    view = {
       type = 'number',
       type = 'number',
       description = 'The view index.'
       description = 'The view index.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'The x coordinate of the view position, in meters.'
       description = 'The x coordinate of the view position, in meters.'
     },
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       type = 'number',
       description = 'The y coordinate of the view position, in meters.'
       description = 'The y coordinate of the view position, in meters.'
     },
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       type = 'number',
       description = 'The z coordinate of the view position, in meters.'
       description = 'The z coordinate of the view position, in meters.'
     },
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       type = 'number',
       description = 'The amount of rotation around the rotation axis, in radians.'
       description = 'The amount of rotation around the rotation axis, in radians.'
     },
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       type = 'number',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       type = 'number',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       type = 'number',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'view' },
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   related = {
   related = {
     'lovr.headset.getViewCount',
     'lovr.headset.getViewCount',
     'lovr.headset.getViewAngles'
     'lovr.headset.getViewAngles'

+ 9 - 6
api/lovr/headset/isDown.lua

@@ -3,20 +3,17 @@ return {
   summary = 'Get the state of a button on a device.',
   summary = 'Get the state of a button on a device.',
   description = 'Returns whether a button on a device is pressed.',
   description = 'Returns whether a button on a device is pressed.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       description = 'The device.'
       description = 'The device.'
     },
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       type = 'DeviceButton',
       description = 'The button.'
       description = 'The button.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'down',
+    down = {
       type = 'boolean',
       type = 'boolean',
       description = [[
       description = [[
         Whether the button on the device is currently pressed, or `nil` if the device does not have
         Whether the button on the device is currently pressed, or `nil` if the device does not have
@@ -24,6 +21,12 @@ return {
       ]]
       ]]
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'down' }
+    }
+  },
   notes = 'When hand tracking is active, pinching will be mapped to the `trigger` button.',
   notes = 'When hand tracking is active, pinching will be mapped to the `trigger` button.',
   related = {
   related = {
     'DeviceButton',
     'DeviceButton',

+ 9 - 6
api/lovr/headset/isTouched.lua

@@ -3,20 +3,17 @@ return {
   summary = 'Check if a button on a device is touched.',
   summary = 'Check if a button on a device is touched.',
   description = 'Returns whether a button on a device is currently touched.',
   description = 'Returns whether a button on a device is currently touched.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       description = 'The device.'
       description = 'The device.'
     },
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       type = 'DeviceButton',
       description = 'The button.'
       description = 'The button.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'touched',
+    touched = {
       type = 'boolean',
       type = 'boolean',
       description = [[
       description = [[
         Whether the button on the device is currently touched, or `nil` if the device does not have
         Whether the button on the device is currently touched, or `nil` if the device does not have
@@ -24,6 +21,12 @@ return {
       ]]
       ]]
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'touched' }
+    }
+  },
   related = {
   related = {
     'DeviceButton',
     'DeviceButton',
     'lovr.headset.isDown',
     'lovr.headset.isDown',

+ 8 - 4
api/lovr/headset/isTracked.lua

@@ -5,20 +5,24 @@ return {
     Returns whether any active headset driver is currently returning pose information for a device.
     Returns whether any active headset driver is currently returning pose information for a device.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to get the pose of.'
       description = 'The device to get the pose of.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'tracked',
+    tracked = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the device is currently tracked.'
       description = 'Whether the device is currently tracked.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'tracked' }
+    }
+  },
   notes = [[
   notes = [[
     If a device is tracked, it is guaranteed to return a valid pose until the next call to
     If a device is tracked, it is guaranteed to return a valid pose until the next call to
     `lovr.headset.update`.
     `lovr.headset.update`.

+ 9 - 6
api/lovr/headset/newModel.lua

@@ -3,14 +3,12 @@ return {
   summary = 'Get a Model for a device.',
   summary = 'Get a Model for a device.',
   description = 'Returns a new Model for the specified device.',
   description = 'Returns a new Model for the specified device.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to load a model for.'
       description = 'The device to load a model for.'
     },
     },
-    {
-      name = 'options',
+    options = {
       type = 'table',
       type = 'table',
       default = '{}',
       default = '{}',
       description = 'Options for loading the model.',
       description = 'Options for loading the model.',
@@ -25,12 +23,17 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'model',
+    model = {
       type = 'Model',
       type = 'Model',
       description = 'The new Model, or `nil` if a model could not be loaded.'
       description = 'The new Model, or `nil` if a model could not be loaded.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'options' },
+      returns = { 'model' }
+    }
+  },
   notes = 'This is only supported on the `openvr` and `vrapi` drivers right now.',
   notes = 'This is only supported on the `openvr` and `vrapi` drivers right now.',
   example = [[
   example = [[
     local models = {}
     local models = {}

+ 13 - 2
api/lovr/headset/renderTo.lua

@@ -12,11 +12,16 @@ return {
     `lovr.draw` as the callback.
     `lovr.draw` as the callback.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'callback',
+    callback = {
       type = 'function',
       type = 'function',
       arguments = {},
       arguments = {},
       returns = {},
       returns = {},
+  variants = {
+    {
+      arguments = { 'callback' },
+      returns = {}
+    }
+  },
       description = [[
       description = [[
         The function used to render.  Any functions called will render to the headset instead of to
         The function used to render.  Any functions called will render to the headset instead of to
         the window.
         the window.
@@ -24,6 +29,12 @@ return {
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'callback' },
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
     When using the `pico` headset driver, headset rendering is asynchronous and the callback passed
     When using the `pico` headset driver, headset rendering is asynchronous and the callback passed
     to `lovr.headset.renderTo` will not be called immediately.
     to `lovr.headset.renderTo` will not be called immediately.

+ 8 - 4
api/lovr/headset/setClipDistance.lua

@@ -6,17 +6,21 @@ return {
     near clipping plane or further than the far clipping plane will be clipped out of view.
     near clipping plane or further than the far clipping plane will be clipped out of view.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'near',
+    near = {
       type = 'number',
       type = 'number',
       description = 'The distance to the near clipping plane, in meters.'
       description = 'The distance to the near clipping plane, in meters.'
     },
     },
-    {
-      name = 'far',
+    far = {
       type = 'number',
       type = 'number',
       description = 'The distance to the far clipping plane, in meters.'
       description = 'The distance to the far clipping plane, in meters.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'near', 'far' },
+      returns = {}
+    }
+  },
   notes = 'The default clip distances are 0.1 and 100.0.'
   notes = 'The default clip distances are 0.1 and 100.0.'
 }
 }

+ 8 - 4
api/lovr/headset/setDisplayFrequency.lua

@@ -3,19 +3,23 @@ return {
   summary = 'Set the display refresh rate.',
   summary = 'Set the display refresh rate.',
   description = 'Sets the display refresh rate, in Hz.',
   description = 'Sets the display refresh rate, in Hz.',
   arguments = {
   arguments = {
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       type = 'number',
       description = 'The new refresh rate, in Hz.',
       description = 'The new refresh rate, in Hz.',
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the display refresh rate was successfully set.'
       description = 'Whether the display refresh rate was successfully set.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'frequency' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
   notes = [[
     Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as
     Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as
     they depend on the display frequency.
     they depend on the display frequency.

+ 11 - 10
api/lovr/headset/vibrate.lua

@@ -5,38 +5,39 @@ return {
     Causes the device to vibrate with a custom strength, duration, and frequency, if possible.
     Causes the device to vibrate with a custom strength, duration, and frequency, if possible.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       default = [['head']],
       default = [['head']],
       description = 'The device to vibrate.'
       description = 'The device to vibrate.'
     },
     },
-    {
-      name = 'strength',
+    strength = {
       type = 'number',
       type = 'number',
       default = '1',
       default = '1',
       description = 'The strength of the vibration (amplitude), between 0 and 1.'
       description = 'The strength of the vibration (amplitude), between 0 and 1.'
     },
     },
-    {
-      name = 'duration',
+    duration = {
       type = 'number',
       type = 'number',
       default = '.5',
       default = '.5',
       description = 'The duration of the vibration, in seconds.'
       description = 'The duration of the vibration, in seconds.'
     },
     },
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       type = 'number',
       default = '0',
       default = '0',
       description = 'The frequency of the vibration, in hertz.  0 will use a default frequency.'
       description = 'The frequency of the vibration, in hertz.  0 will use a default frequency.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'vibrated',
+    vibrated = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the vibration was successfully triggered by an active headset driver.'
       description = 'Whether the vibration was successfully triggered by an active headset driver.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'strength', 'duration', 'frequency' },
+      returns = { 'vibrated' }
+    }
+  },
   notes = [[
   notes = [[
     When using the `openvr` headset driver on an HTC Vive, the value for the `duration` currently
     When using the `openvr` headset driver on an HTC Vive, the value for the `duration` currently
     must be less than .004 seconds.  Call this function several frames in a row for stronger or
     must be less than .004 seconds.  Call this function several frames in a row for stronger or

+ 9 - 6
api/lovr/headset/wasPressed.lua

@@ -3,24 +3,27 @@ return {
   summary = 'Check if a button was just pressed.',
   summary = 'Check if a button was just pressed.',
   description = 'Returns whether a button on a device was pressed this frame.',
   description = 'Returns whether a button on a device was pressed this frame.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       description = 'The device.'
       description = 'The device.'
     },
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       type = 'DeviceButton',
       description = 'The button to check.'
       description = 'The button to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'pressed',
+    pressed = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the button on the device was pressed this frame.'
       description = 'Whether the button on the device was pressed this frame.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'pressed' }
+    }
+  },
   notes = [[
   notes = [[
     Some headset backends are not able to return pressed/released information.  These drivers will
     Some headset backends are not able to return pressed/released information.  These drivers will
     always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.
     always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.

+ 9 - 6
api/lovr/headset/wasReleased.lua

@@ -3,24 +3,27 @@ return {
   summary = 'Check if a button was just released.',
   summary = 'Check if a button was just released.',
   description = 'Returns whether a button on a device was released this frame.',
   description = 'Returns whether a button on a device was released this frame.',
   arguments = {
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       type = 'Device',
       description = 'The device.'
       description = 'The device.'
     },
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       type = 'DeviceButton',
       description = 'The button to check.'
       description = 'The button to check.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'released',
+    released = {
       type = 'boolean',
       type = 'boolean',
       description = 'Whether the button on the device was released this frame.'
       description = 'Whether the button on the device was released this frame.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'released' }
+    }
+  },
   notes = [[
   notes = [[
     Some headset backends are not able to return pressed/released information.  These drivers will
     Some headset backends are not able to return pressed/released information.  These drivers will
     always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.
     always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.

+ 7 - 1
api/lovr/math/drain.lua

@@ -7,5 +7,11 @@ return {
     This is called automatically at the end of each frame.
     This is called automatically at the end of each frame.
   ]],
   ]],
   arguments = {},
   arguments = {},
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  }
 }
 }

+ 7 - 2
api/lovr/math/getRandomSeed.lua

@@ -4,10 +4,15 @@ return {
   description = 'Get the seed used to initialize the random generator.',
   description = 'Get the seed used to initialize the random generator.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'seed',
+    seed = {
       type = 'number',
       type = 'number',
       description = 'The new seed.'
       description = 'The new seed.'
     }
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'seed' }
+    }
   }
   }
 }
 }

+ 9 - 6
api/lovr/math/randomNormal.lua

@@ -6,8 +6,7 @@ return {
     center of the bell curve (the mean value) and the overall width (sigma, or standard deviation).
     center of the bell curve (the mean value) and the overall width (sigma, or standard deviation).
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'sigma',
+    sigma = {
       type = 'number',
       type = 'number',
       default = '1',
       default = '1',
       description = [[
       description = [[
@@ -15,20 +14,24 @@ return {
         numbers is or how much variability there is.
         numbers is or how much variability there is.
       ]]
       ]]
     },
     },
-    {
-      name = 'mu',
+    mu = {
       type = 'number',
       type = 'number',
       default = '0',
       default = '0',
       description = 'The average value returned.'
       description = 'The average value returned.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       type = 'number',
       description = 'A normally distributed pseudo-random number.'
       description = 'A normally distributed pseudo-random number.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'sigma', 'mu' },
+      returns = { 'x' }
+    }
+  },
   related = {
   related = {
     'lovr.math.random',
     'lovr.math.random',
     'RandomGenerator'
     'RandomGenerator'

Some files were not shown because too many files changed in this diff