Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ExtractEmmyLuaAPI command #21109

Merged
merged 3 commits into from Oct 14, 2023
Merged

Conversation

penev92
Copy link
Member

@penev92 penev92 commented Oct 11, 2023

Fixes OpenRA/vscode-openra-lua#13, fixes OpenRA/vscode-openra-lua#14 by:

  1. Changing how Actor and Player properties are represented in the generated Lua API file - switching from table entries annotated with @type to just @field annotations on the class (table).
    BONUS: Makes a distinction between readonly and "normal" properties now!
image
  1. Marks all actor inits as nullable/optional members of the InitTable type. (All except OwnerInit).

Also disabled warnings inside the generated file about unused method parameters, because of course they are unused there.

You can see a diff in the generated file in OpenRA/vscode-openra-lua#15.

The Lua extension would report missing/uninitialized fields on actor creation because it thought they were required. This makes them all optional, except for OwnerInit, which is special.
A recent update in the Lua extension makes it consider all fields that are defined as table entries annotated with @type to be readonly (providing a somewhat misleading warning saying that they don't exist). Defining them as @field annotations on the class makes it tread them normally.
This affects ScriptActorProperties and ScriptPlayerProperties.
@Mailaender Mailaender merged commit c0f3f97 into OpenRA:bleed Oct 14, 2023
3 checks passed
@Mailaender
Copy link
Member

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InitTable members are all considered required Actor/Player properties are considered readonly
2 participants