Skip to content

Commit

Permalink
feature: add docs types to config options
Browse files Browse the repository at this point in the history
  • Loading branch information
adalessa committed Mar 1, 2024
1 parent e1b36c0 commit d504935
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
19 changes: 19 additions & 0 deletions lua/laravel/config/default.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
---@class NullLsFeature
---@field enable boolean

---@class RouteInfoFeature
---@field enable boolean
---@field position string

---@class LaravelFeatures
---@field null_ls NullLsFeature
---@field route_info RouteInfoFeature

---@class LaravelOptions
---@field lsp_server string
---@field register_user_commands boolean
---@field features LaravelFeatures
---@field ui LaravelOptionsUI
---@field commands_options table
---@field environments LaravelOptionsEnvironments
---@field user_commands table
return {
lsp_server = "phpactor",
register_user_commands = true,
Expand Down
13 changes: 13 additions & 0 deletions lua/laravel/config/environments.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---@class EnvironmentCondition
---@field file_exists string[]

---@class LaravelEnvironmentConfig
---@field name string
---@field condition EnvironmentCondition
---@field commands table

---@class LaravelOptionsEnvironments
---@field env_variable string
---@field auto_dicover boolean
---@field default string
---@field definitions LaravelEnvironmentConfig[]
return {
env_variable = "NVIM_LARAVEL_ENV",
auto_dicover = true,
Expand Down
2 changes: 1 addition & 1 deletion lua/laravel/config/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local M = {}

---@class LaravelOptions
---@type LaravelOptions
M.defaults = require "laravel.config.default"

--- @type LaravelOptions
Expand Down
15 changes: 15 additions & 0 deletions lua/laravel/config/ui.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
---@class NuiOptions
---@field enter boolean
---@field relative string
---@field position string|table
---@field size string|table
---@field buf_options table
---@field win_options table

---@class LaravelOptionsUINui
---@field split NuiOptions
---@field popup NuiOptions

---@class LaravelOptionsUI
---@field default string
---@field nui_opts LaravelOptionsUINui
return {
default = "split",
nui_opts = {
Expand Down

0 comments on commit d504935

Please sign in to comment.