protected :new

This commit is contained in:
Alexander Courtis 2024-11-08 17:55:15 +11:00
parent 82fc5296ff
commit 412475e4f7
21 changed files with 22 additions and 12 deletions

View File

@ -28,6 +28,7 @@ local Clipboard = Class:extend()
---@class (exact) ClipboardArgs ---@class (exact) ClipboardArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args ClipboardArgs ---@param args ClipboardArgs
function Clipboard:new(args) function Clipboard:new(args)
self.explorer = args.explorer self.explorer = args.explorer

View File

@ -19,6 +19,7 @@ local HighlightDisplay = Class:extend()
---@class (exact) HighlightDisplayArgs ---@class (exact) HighlightDisplayArgs
---@field group string nvim-tree highlight group name ---@field group string nvim-tree highlight group name
---@protected
---@param args HighlightDisplayArgs ---@param args HighlightDisplayArgs
function HighlightDisplay:new(args) function HighlightDisplay:new(args)
self.group = args.group self.group = args.group

View File

@ -16,6 +16,7 @@ local Class = {}
Class.__index = Class ---@diagnostic disable-line: inject-field Class.__index = Class ---@diagnostic disable-line: inject-field
---Default constructor ---Default constructor
---@protected
function Class:new(...) --luacheck: ignore 212 function Class:new(...) --luacheck: ignore 212
end end

View File

@ -20,6 +20,7 @@ local Filters = Class:extend()
---@class (exact) FiltersArgs ---@class (exact) FiltersArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args FiltersArgs ---@param args FiltersArgs
function Filters:new(args) function Filters:new(args)
self.explorer = args.explorer self.explorer = args.explorer

View File

@ -43,6 +43,7 @@ local Explorer = RootNode:extend()
---@class (exact) ExplorerArgs ---@class (exact) ExplorerArgs
---@field path string ---@field path string
---@protected
---@param args ExplorerArgs ---@param args ExplorerArgs
function Explorer:new(args) function Explorer:new(args)
Explorer.super.new(self, { Explorer.super.new(self, {

View File

@ -18,6 +18,7 @@ local LiveFilter = Class:extend()
---@class (exact) LiveFilterArgs ---@class (exact) LiveFilterArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args LiveFilterArgs ---@param args LiveFilterArgs
function LiveFilter:new(args) function LiveFilter:new(args)
self.explorer = args.explorer self.explorer = args.explorer

View File

@ -20,6 +20,7 @@ local Sorter = Class:extend()
---@class (exact) SorterArgs ---@class (exact) SorterArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args SorterArgs ---@param args SorterArgs
function Sorter:new(args) function Sorter:new(args)
self.state = vim.deepcopy(args.explorer.opts.sort) self.state = vim.deepcopy(args.explorer.opts.sort)

View File

@ -24,7 +24,7 @@ local GitRunner = Class:extend()
local timeouts = 0 local timeouts = 0
local MAX_TIMEOUTS = 5 local MAX_TIMEOUTS = 5
---@private ---@protected
---@param args GitRunnerArgs ---@param args GitRunnerArgs
function GitRunner:new(args) function GitRunner:new(args)
self.args = args self.args = args

View File

@ -22,6 +22,7 @@ local Marks = Class:extend()
---@class (exact) MarksArgs ---@class (exact) MarksArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args MarksArgs ---@param args MarksArgs
function Marks:new(args) function Marks:new(args)
self.explorer = args.explorer self.explorer = args.explorer

View File

@ -8,7 +8,7 @@ local LinkNode = Class:extend()
---@class (exact) LinkNodeArgs: NodeArgs ---@class (exact) LinkNodeArgs: NodeArgs
---@field link_to string ---@field link_to string
---@field fs_stat_target uv.fs_stat.result ---@field fs_stat_target uv.fs_stat.result
---
---@protected ---@protected
---@param args LinkNodeArgs ---@param args LinkNodeArgs
function LinkNode:new(args) function LinkNode:new(args)

View File

@ -47,6 +47,7 @@ local Builder = Class:extend()
---@class (exact) BuilderArgs ---@class (exact) BuilderArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args BuilderArgs ---@param args BuilderArgs
function Builder:new(args) function Builder:new(args)
self.explorer = args.explorer self.explorer = args.explorer

View File

@ -7,7 +7,7 @@ local DecoratorBookmarks = Decorator:extend()
---@class DecoratorBookmarks ---@class DecoratorBookmarks
---@overload fun(explorer: DecoratorArgs): DecoratorBookmarks ---@overload fun(explorer: DecoratorArgs): DecoratorBookmarks
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorBookmarks:new(args) function DecoratorBookmarks:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -6,7 +6,7 @@ local DecoratorCopied = Decorator:extend()
---@class DecoratorCopied ---@class DecoratorCopied
---@overload fun(explorer: DecoratorArgs): DecoratorCopied ---@overload fun(explorer: DecoratorArgs): DecoratorCopied
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorCopied:new(args) function DecoratorCopied:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -6,7 +6,7 @@ local DecoratorCut = Decorator:extend()
---@class DecoratorCut ---@class DecoratorCut
---@overload fun(explorer: DecoratorArgs): DecoratorCut ---@overload fun(explorer: DecoratorArgs): DecoratorCut
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorCut:new(args) function DecoratorCut:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -37,7 +37,7 @@ local DecoratorDiagnostics = Decorator:extend()
---@class DecoratorDiagnostics ---@class DecoratorDiagnostics
---@overload fun(explorer: DecoratorArgs): DecoratorDiagnostics ---@overload fun(explorer: DecoratorArgs): DecoratorDiagnostics
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorDiagnostics:new(args) function DecoratorDiagnostics:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -22,7 +22,7 @@ local DecoratorGit = Decorator:extend()
---@class DecoratorGit ---@class DecoratorGit
---@overload fun(explorer: DecoratorArgs): DecoratorGit ---@overload fun(explorer: DecoratorArgs): DecoratorGit
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorGit:new(args) function DecoratorGit:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -8,7 +8,7 @@ local DecoratorHidden = Decorator:extend()
---@class DecoratorHidden ---@class DecoratorHidden
---@overload fun(explorer: DecoratorArgs): DecoratorHidden ---@overload fun(explorer: DecoratorArgs): DecoratorHidden
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorHidden:new(args) function DecoratorHidden:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -10,7 +10,7 @@ local DecoratorModified = Decorator:extend()
---@class DecoratorModified ---@class DecoratorModified
---@overload fun(explorer: DecoratorArgs): DecoratorModified ---@overload fun(explorer: DecoratorArgs): DecoratorModified
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorModified:new(args) function DecoratorModified:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -9,7 +9,7 @@ local DecoratorOpened = Decorator:extend()
---@class DecoratorOpened ---@class DecoratorOpened
---@overload fun(explorer: DecoratorArgs): DecoratorOpened ---@overload fun(explorer: DecoratorArgs): DecoratorOpened
---@private ---@protected
---@param args DecoratorArgs ---@param args DecoratorArgs
function DecoratorOpened:new(args) function DecoratorOpened:new(args)
Decorator.new(self, { Decorator.new(self, {

View File

@ -21,6 +21,7 @@ local Renderer = Class:extend()
---@class (exact) RendererArgs ---@class (exact) RendererArgs
---@field explorer Explorer ---@field explorer Explorer
---@protected
---@param args RendererArgs ---@param args RendererArgs
function Renderer:new(args) function Renderer:new(args)
self.explorer = args.explorer self.explorer = args.explorer

View File

@ -32,7 +32,7 @@ local Event = Class:extend()
---@class (exact) EventArgs ---@class (exact) EventArgs
---@field path string ---@field path string
---@private ---@protected
---@param args EventArgs ---@param args EventArgs
function Event:new(args) function Event:new(args)
self.destroyed = false self.destroyed = false
@ -160,7 +160,7 @@ local Watcher = Class:extend()
---@field callback fun(watcher: Watcher) ---@field callback fun(watcher: Watcher)
---@field data table? user data ---@field data table? user data
---@private ---@protected
---@param args WatcherArgs ---@param args WatcherArgs
function Watcher:new(args) function Watcher:new(args)
self.data = args.data self.data = args.data