-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
---@alias LazyEvent {id:string, event:string[]|string, pattern?:string[]|string} | ||
---@alias LazyEventSpec string|{event?:string|string[], pattern?:string|string[]}|string[] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
---@alias GitInfo {branch?:string, commit?:string, tag?:string, version?:Semver} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
---@class LazyKeysBase | ||
---@field desc? string | ||
---@field noremap? boolean | ||
---@field remap? boolean | ||
---@field expr? boolean | ||
---@field nowait? boolean | ||
---@field ft? string|string[] | ||
|
||
---@class LazyKeysSpec: LazyKeysBase | ||
---@field [1] string lhs | ||
---@field [2]? string|fun()|false rhs | ||
---@field mode? string|string[] | ||
|
||
---@class LazyKeys: LazyKeysBase | ||
---@field lhs string lhs | ||
---@field rhs? string|fun() rhs | ||
---@field mode? string | ||
---@field id string | ||
---@field name string |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
---@class Semver | ||
---@field [1] number | ||
---@field [2] number | ||
---@field [3] number | ||
---@field major number | ||
---@field minor number | ||
---@field patch number | ||
---@field prerelease? string | ||
---@field build? string |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
---@class TaskOptions: {[string]:any} | ||
---@field on_done? fun(task:LazyTask) | ||
|
||
---@class LazyTaskDef | ||
---@field skip? fun(plugin:LazyPlugin, opts?:TaskOptions):any? | ||
---@field run fun(task:LazyTask, opts:TaskOptions) | ||
|
||
---@alias LazyTaskState fun():boolean? | ||
|
||
---@class LazyTask | ||
---@field plugin LazyPlugin | ||
---@field name string | ||
---@field output string | ||
---@field status string | ||
---@field error? string | ||
---@field private _task fun(task:LazyTask) | ||
---@field private _running LazyPluginState[] | ||
---@field private _started? number | ||
---@field private _ended? number | ||
---@field private _opts TaskOptions |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
---@alias LazyPluginKind "normal"|"clean"|"disabled" | ||
|
||
---@class LazyPluginState | ||
---@field fid number id of the plugin spec fragment | ||
---@field fpid? number parent id of the plugin spec fragment | ||
---@field fdeps? number[] children ids of the fragment | ||
---@field loaded? {[string]:string}|{time:number} | ||
---@field installed? boolean | ||
---@field tasks? LazyTask[] | ||
---@field working? boolean | ||
---@field dirty? boolean | ||
---@field updated? {from:string, to:string} | ||
---@field is_local? boolean | ||
---@field updates? {from:GitInfo, to:GitInfo} | ||
---@field cloned? boolean | ||
---@field outdated? boolean | ||
---@field kind? LazyPluginKind | ||
---@field dep? boolean True if this plugin is only in the spec as a dependency | ||
---@field cond? boolean | ||
---@field super? LazyPlugin | ||
---@field module? string | ||
---@field dir? string Explicit dir or dev set for this plugin | ||
---@field rtp_loaded? boolean | ||
---@field handlers? LazyPluginHandlers | ||
---@field cache? table<string,any> | ||
|
||
---@alias PluginOpts table|fun(self:LazyPlugin, opts:table):table? | ||
|
||
---@class LazyPluginHooks | ||
---@field init? fun(self:LazyPlugin) Will always be run | ||
---@field deactivate? fun(self:LazyPlugin) Unload/Stop a plugin | ||
---@field config? fun(self:LazyPlugin, opts:table)|true Will be executed when loading the plugin | ||
---@field build? string|fun(self:LazyPlugin)|(string|fun(self:LazyPlugin))[] | ||
---@field opts? PluginOpts | ||
|
||
---@class LazyPluginHandlers | ||
---@field event? table<string,LazyEvent> | ||
---@field ft? table<string,LazyEvent> | ||
---@field keys? table<string,LazyKeys> | ||
---@field cmd? table<string,string> | ||
|
||
---@class LazyPluginRef | ||
---@field branch? string | ||
---@field tag? string | ||
---@field commit? string | ||
---@field version? string | ||
---@field pin? boolean | ||
---@field submodules? boolean Defaults to true | ||
|
||
---@class LazyPluginBase | ||
---@field [1] string? | ||
---@field name string display name and name used for plugin config files | ||
---@field main? string Entry module that has setup & deactivate | ||
---@field url string? | ||
---@field dir string | ||
---@field enabled? boolean|(fun():boolean) | ||
---@field cond? boolean|(fun():boolean) | ||
---@field optional? boolean If set, then this plugin will not be added unless it is added somewhere else | ||
---@field lazy? boolean | ||
---@field priority? number Only useful for lazy=false plugins to force loading certain plugins first. Default priority is 50 | ||
---@field dev? boolean If set, then link to the respective folder under your ~/projects | ||
|
||
---@class LazyPlugin: LazyPluginBase,LazyPluginHandlers,LazyPluginHooks,LazyPluginRef | ||
---@field dependencies? string[] | ||
---@field _ LazyPluginState |