Thread Tools Display Modes
Prev Previous Post   Next Post Next
Yesterday, 03:37 AM   #1
SirNightstorm
Join Date: Oct 2017
Posts: 1
Autocompletion files ---@return parameters

Hi Baertram, all,

Not sure if I'm being dumb, but...

The immensely useful JetBrains IntelliJ IDEA autocompletion files have return annotations like this one:

Code:
--- @return gameTimeInSeconds number
function GetGameTimeSeconds() end
...whereas the EmmyLua docs (and the linting that I'm seeing in VSCode) expects:

Code:
---@return MY_TYPE[|OTHER_TYPE] [@comment]
The upshot being that this code:

Code:
local t = 0
GetFrameTimeSeconds()
gives an IDE warning:

Code:
This variable is defined as type `number`. Cannot convert its type to `gameTimeInSeconds`.
- `gameTimeInSeconds` cannot match `number`
- Type `gameTimeInSeconds` cannot match `number`Lua Diagnostics.(cast-local-type)
Just wanted to know if I'm missing something obvious?

Thanks,
David
  Reply With Quote
 

ESOUI » Developer Discussions » Dev Tools » Autocompletion files ---@return parameters


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off