Quality of Life Improvements for UI namespace#738
Merged
Endaris merged 4 commits intopanel-attack:betafrom Jan 24, 2026
Merged
Conversation
…r to facilitate easier navigation in the UI "namespace"
add some comments what to annotate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There will be a bunch of smaller PRs that I'll try to extract from #649 that provide some tangible benefits for the project without the rest of the resizeable UI package.
With the PATH substitution for the requires in ui/init.lua, the requires only get resolved at runtime. That's bad because it means LuaLS does not resolve them when running diagnostics and intellisense stops there. One idea of doing that in the first place was making the entire ui folder easy to move around as a package without having to adjust all explicit requires
Introduce: Relative require via a dedicated import function
Internally this accesses lua's debug functions to figure out the actual path and make a path substitution. Simple enough, does on its own not solve the above problem as that too is a runtime property.
Introduce next: The plugin functionality of LuaLS. By using an
OnSetTextmethod we can effectively "live search & replace". Which means we can pattern match forimport("%s")and then replace the import with an actual full path require that LuaLS then resolves correctly so that Intellisense can work for these.By annotating each entry in the ui table with
---@source filename.lua, Go To Source/F12 immediately directs to the correct file instead of init.lua and if the ui class itself is properly annotated it starts to be not that terrible.