Finished(?) annotation parsing
Small fixes for the parser
This commit is contained in:
2599
src/LuaLS.lua
2599
src/LuaLS.lua
File diff suppressed because it is too large
Load Diff
@@ -51,19 +51,22 @@ function Display:init(props, basalt)
|
||||
end
|
||||
|
||||
self:observe("width", function(self, width)
|
||||
local window = self.get("window")
|
||||
local window = self._window
|
||||
if window then
|
||||
window.reposition(1, 1, width, self.get("height"))
|
||||
end
|
||||
end)
|
||||
self:observe("height", function(self, height)
|
||||
local window = self.get("window")
|
||||
local window = self._window
|
||||
if window then
|
||||
window.reposition(1, 1, self.get("width"), height)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
--- Returns the current window object
|
||||
--- @shortDescription Returns the current window object
|
||||
--- @return table window The current window object
|
||||
function Display:getWindow()
|
||||
return self._window
|
||||
end
|
||||
|
||||
@@ -419,8 +419,7 @@ function VisualElement:setCursor(x, y, blink, color)
|
||||
return self
|
||||
end
|
||||
|
||||
--- This function is used to prioritize the element by moving it to the top of its parent's children.
|
||||
--- It removes the element from its parent and adds it back, effectively changing its order.
|
||||
--- This function is used to prioritize the element by moving it to the top of its parent's children. It removes the element from its parent and adds it back, effectively changing its order.
|
||||
--- @shortDescription Prioritizes the element by moving it to the top of its parent's children
|
||||
--- @return VisualElement self The VisualElement instance
|
||||
function VisualElement:prioritize()
|
||||
|
||||
@@ -163,6 +163,7 @@ function BaseElement:applyTheme()
|
||||
self.set(prop, value)
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the theme properties for this element
|
||||
@@ -179,26 +180,26 @@ end
|
||||
|
||||
--- The Theme API provides methods for managing themes globally
|
||||
---@class ThemeAPI
|
||||
local themeAPI = {}
|
||||
local ThemeAPI = {}
|
||||
|
||||
--- Sets the current theme
|
||||
--- @shortDescription Sets a new theme
|
||||
--- @param newTheme table The theme configuration to set
|
||||
function themeAPI.setTheme(newTheme)
|
||||
function ThemeAPI.setTheme(newTheme)
|
||||
themes.default = newTheme
|
||||
end
|
||||
|
||||
--- Gets the current theme configuration
|
||||
--- @shortDescription Gets the current theme
|
||||
--- @return table theme The current theme configuration
|
||||
function themeAPI.getTheme()
|
||||
function ThemeAPI.getTheme()
|
||||
return themes.default
|
||||
end
|
||||
|
||||
--- Loads a theme from a JSON file
|
||||
--- @shortDescription Loads theme from JSON file
|
||||
--- @param path string Path to the theme JSON file
|
||||
function themeAPI.loadTheme(path)
|
||||
function ThemeAPI.loadTheme(path)
|
||||
local file = fs.open(path, "r")
|
||||
if file then
|
||||
local content = file.readAll()
|
||||
@@ -209,5 +210,5 @@ end
|
||||
|
||||
return {
|
||||
BaseElement = BaseElement,
|
||||
API = themeAPI
|
||||
API = ThemeAPI
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ function PropertySystem:observe(name, callback)
|
||||
end
|
||||
|
||||
--- Removes an observer from a property
|
||||
--- @NshortDescription Removes an observer from a property
|
||||
--- @shortDescription Removes an observer from a property
|
||||
--- @param name string The name of the property
|
||||
--- @param callback function The callback function to remove
|
||||
--- @return table self The PropertySystem
|
||||
|
||||
Reference in New Issue
Block a user