refactor: move types into relevant places #62
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mupen64/ugui!62
Loading…
Reference in a new issue
No description provided.
Delete branch "disperse-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deletes the centralized
types.luaand moves the type definitions to more relevant places.Pull request overview
This PR removes the centralized
src/ugui/types.luaand redistributes ugui’s EmmyLua/LuaLS type annotations (and a few runtime enums/tables) into the modules where they’re most relevant.Changes:
src/ugui/types.luaand moved shared aliases/enums intocore.lua, scene entry typing intointernal.lua, and control-specific types into each control module.src/ugui/environment/keycode.luaforugui.keycodes+ key event types.build.pyamalgamation list to include the new files and stop includingtypes.lua.Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
SceneEntryalias near scene state.ugui.keycodesandUguiKeyEventArgs.UID,RichText,ControlRegistryEntry, visual/signal states) here.Controlclass annotation.Buttonclass annotation.ToggleButtonclass annotation.CarrouselButtonclass annotation.ComboBoxclass annotation.TextBoxclass annotation.Joystickclass annotation.Trackbarclass annotation.ListBoxclass annotation.ScrollBarclass annotation.MenuItem,MenuResult, andMenuclass annotations.NumberBoxclass annotation.TabControl/TabControlResultclass annotations.Spinnerclass annotation.src/ugui/types.luafrom ugui job; addedenvironment/keycode.luaandcontrols/control.lua.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
@ -29,14 +29,15 @@ JOBS: list[tuple[list[Path], Path]] = [(In the ugui amalgamation order,
environment/env.luaannotatesEnvironment.key_eventsasUguiKeyEventArgs[], butUguiKeyEventArgsis currently defined later inenvironment/keycode.lua. If consumers rely on the generatedbuild/ugui-amalgamated.luafor LuaLS/EmmyLua type info, this ordering can makeUguiKeyEventArgsunresolved. Consider movingkeycode.luaearlier thanenv.luain the JOBS list (or moving theUguiKeyEventArgstype toenv.lua).@ -39,3 +39,4 @@Path("src/ugui/styler.lua"),Path("src/ugui/controls/control.lua"),Path("src/ugui/controls/label.lua"),Path("src/ugui/controls/button.lua"),core.luadefinesControlRegistryEntryusing theControltype, but theControlclass annotation was moved tosrc/ugui/controls/control.lua, which is concatenated aftercore.lua(and afterinternal.lua) in the amalgamation order. This can causeControlto be unresolved in the generated amalgamated file’s type annotations. Consider relocating theControltype definition tocore.lua(near the other shared types) or introducing an earlier-loaded shared types file soControlis defined before any references incore.lua/internal.lua.