Skip to content

Commit

Permalink
feat: add auto completion with lua_ls
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Aug 3, 2023
1 parent fce383d commit 4a6995b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .neoconf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"neodev": {
"library": {
"enabled": true,
"plugins": true
"plugins": ["heirline.nvim"]
}
},
"neoconf": {
Expand All @@ -15,9 +15,7 @@
"lspconfig": {
"lua_ls": {
"Lua.format.enable": false,
"Lua.diagnostics.globals": [
"astronvim"
]
"Lua.diagnostics.globals": ["astronvim"]
}
}
}
1 change: 1 addition & 0 deletions lua/astroui/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
-- @copyright 2023
-- @license GNU General Public License v3.0

---@type AstroUIConfig
return {
--- Colorscheme set on startup
-- @usage colorscheme = "astrodark"
Expand Down
3 changes: 3 additions & 0 deletions lua/astroui/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ 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
31 changes: 31 additions & 0 deletions lua/astroui/types.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---@meta

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

---@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
---@field colorscheme string?
---@field highlights table<string,table<string,table>>?
---@field icons AstroUIIconTable?
---@field text_icons AstroUIIconTable?
---@field status AstroUIStatusOpts?

1 comment on commit 4a6995b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.