You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Annotations in inline comments do not recognize others on the same line #3350
Placing multiple annotations in inline comments like so works fine: the generics are interpreted correctly.
--[[@generic C]]--[[@param any C]]--[[@return C]]localfunctionexampleGeneric(any) returnanyend
So one would expect grouping them together on the same line (like this) would also work:
--[[@generic C]]--[[@param any C]]--[[@return C]]localfunctionexampleGeneric(any) returnanyend
Actual Behaviour
In the previous example, the generic seems to be defined, but doesn't carry over properly to the other two annotations. Similarly, adding a line break between the first and second annotation like this
--[[@generic C]]--[[@param any C]]--[[@return C]]localfunctionexampleGeneric(any) returnanyend
allows the generic to be recognized by the second annotation, but not the third. This behavior is also visible in other annotations that require others to be nearby, such as with classes and fields, and aliases.
Reproduction steps
Open VSCode
Paste either of the following examples into an empty lua file:
--[[@generic C]]--[[@param any C]]--[[@return C]]localfunctionexampleGeneric(any) returnanyend
Additional Notes
While I realize there is little practical use for some of these cases, such as the class definition (as it starts to take up a lot of horizontal space really quickly when defining new fields), this is especially useful when creating a plugin that allows for inline annotation definitions like the following:
Activity