Skip to content

Commit

Permalink
feat: move to lua_ls only annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Aug 3, 2023
1 parent 2909171 commit d52b41f
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 109 deletions.
11 changes: 0 additions & 11 deletions config.ld

This file was deleted.

104 changes: 76 additions & 28 deletions lua/astroui/config.lua
Original file line number Diff line number Diff line change
@@ -1,41 +1,87 @@
--- ### AstroNvim UI Configuration
-- AstroNvim UI Configuration
--
-- This module simply defines the configuration table structure for `opts` used in:
--
-- require("astroui").setup(opts)
--
-- @module astroui.config
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

---@alias AstroUIIconTable table<string,string>
---@alias AstroUIIconHighlight (fun(self:table):boolean)|boolean

---@class AstroUIFullIconHighlights
---@field tabline AstroUIIconHighlight?
---@field statusline AstroUIIconHighlight?
---@field winbar AstroUIIconHighlight?

---@class AstroUIIconHighlights
---@field breadcrumbs AstroUIIconHighlight?
---@field file_icon AstroUIFullIconHighlights?

---@class AstroUIStatusOpts
---@field attributes table<string,table>?
---@field buf_matchers table<string,fun(pattern_list:string[],bufnr:integer):boolean>?
---@field colors table<string,string>?
---@field fallback_colors table<string,string>?
---@field icon_hignlights AstroUIIconHighlights?
---@field modes table<string,string[]>?
---@field separators table<string,string[]|string>?
---@field setup_colors (fun():table)?
---@field sign_handlers table<string,fun(args:table)>?

---@class AstroUIConfig
-- Colorscheme set on startup, a string that is used with `:colorscheme astrodark`
-- Example:
--
-- ```lua
-- colorscheme = "astrodark"
-- ```
---@field colorscheme string?
-- Override highlights in any colorscheme
-- Keys can be:
-- `init`: table of highlights to apply to all colorschemes
-- `<colorscheme_name>` override highlights in the colorscheme with name: `<colorscheme_name>`
-- Example:
--
-- ```lua
-- highlights = {
-- -- this table overrides highlights in all colorschemes
-- init = {
-- Normal = { bg = "#000000" },
-- },
-- -- a table of overrides/changes when applying astrotheme
-- astrotheme = {
-- Normal = { bg = "#000000" },
-- },
-- }
-- ```
---@field highlights table<string,table<string,table>>?
-- A table of icons in the UI using NERD fonts
-- Example:
--
-- ```lua
-- icons = {
-- GitAdd = "",
-- }
-- ```
---@field icons AstroUIIconTable?
--- A table of only text "icons" used when icons are disabled
-- Example:
--
-- ```lua
-- text_icons = {
-- GitAdd = "[+]",
-- }
-- ```
---@field text_icons AstroUIIconTable?
---@field status AstroUIStatusOpts?

---@type AstroUIConfig
return {
--- Colorscheme set on startup
-- @usage colorscheme = "astrodark"
local M = {
colorscheme = nil,
--- Override highlights in any colorscheme
-- @field init table of highlights to apply to all colorschemes
-- @field colorscheme_name override highlights in the colorscheme with name: `colorscheme_name`
-- @usage highlights = {
-- -- this table overrides highlights in all colorschemes
-- init = {
-- Normal = { bg = "#000000" },
-- },
-- -- a table of overrides/changes when applying astrotheme
-- astrotheme = {
-- Normal = { bg = "#000000" },
-- },
-- }
highlights = {},
--- A table of icons in the UI using NERD fonts
-- @usage icons = {
-- GitAdd = "",
-- }
icons = {},
--- A table of only text "icons" used when icons are disabled
-- @usage text_icons = {
-- GitAdd = "[+]",
-- }
text_icons = {},
status = {
attributes = {},
Expand All @@ -49,3 +95,5 @@ return {
sign_handlers = {},
},
}

return M
2 changes: 1 addition & 1 deletion lua/astroui/ffi.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- ### AstroUI C Extensions
-- AstroUI C Extensions

local ffi = require "ffi"

Expand Down
8 changes: 3 additions & 5 deletions lua/astroui/init.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
--- ### AstroNvim UI Utilities
-- AstroNvim UI Utilities
--
-- UI utility functions to use within AstroNvim and user configurations.
--
-- This module can be loaded with `local astro = require "astroui"`
--
-- @module astroui
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

M.config = require "astroui.config"

--- Setup and configure AstroUI
---@param opts AstroUIConfig
---@see astroui.config
function M.setup(opts)
M.config = vim.tbl_deep_extend("force", M.config, opts)

Expand Down
8 changes: 3 additions & 5 deletions lua/astroui/status.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
--- ### AstroNvim Status Utilities
-- AstroNvim Status Utilities
--
-- Status utility functions to use within AstroNvim and user configurations.
--
-- This module can be loaded with `local astro = require "astroui.status"`
--
-- @module astroui.status
-- @see astroui
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

return {
--- @see astroui.status.component
Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/component.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Components
-- AstroNvim Status Components
--
-- Statusline related component functions to use with Heirline
--
-- This module can be loaded with `local component = require "astroui.status.component"`
--
-- @module astroui.status.component
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/condition.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Conditions
-- AstroNvim Status Conditions
--
-- Statusline related condition functions to use with Heirline
--
-- This module can be loaded with `local condition = require "astroui.status.condition"`
--
-- @module astroui.status.condition
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/heirline.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Heirline Extensions
-- AstroNvim Status Heirline Extensions
--
-- Statusline related heirline specific extensions
--
-- This module can be loaded with `local astro_heirline = require "astroui.status.heirline"`
--
-- @module astroui.status.heirline
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/hl.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Highlighting
-- AstroNvim Status Highlighting
--
-- Statusline related highlighting utilities
--
-- This module can be loaded with `local hl = require "astroui.status.hl"`
--
-- @module astroui.status.hl
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/init.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Initializers
-- AstroNvim Status Initializers
--
-- Statusline related init functions for building dynamic statusline components
--
-- This module can be loaded with `local init = require "astroui.status.init"`
--
-- @module astroui.status.init
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/provider.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Providers
-- AstroNvim Status Providers
--
-- Statusline related provider functions for building statusline components
--
-- This module can be loaded with `local provider = require "astroui.status.provider"`
--
-- @module astroui.status.provider
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/astroui/status/utils.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- ### AstroNvim Status Utilities
-- AstroNvim Status Utilities
--
-- Statusline related uitility functions
--
-- This module can be loaded with `local status_utils = require "astroui.status.utils"`
--
-- @module astroui.status.utils
-- @copyright 2023
-- @license GNU General Public License v3.0
-- copyright 2023
-- license GNU General Public License v3.0

local M = {}

Expand Down
31 changes: 0 additions & 31 deletions lua/astroui/types.lua

This file was deleted.

0 comments on commit d52b41f

Please sign in to comment.