Skip to content

Add type hints to plugin options where possible #1494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 38 additions & 10 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,16 @@ require('lazy').setup({
-- See `:help gitsigns` to understand what the configuration keys do
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
---@module 'gitsigns'
---@type Gitsigns.Config
---@diagnostic disable-next-line: missing-fields
opts = {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '‾' },
changedelete = { text = '~' },
add = { text = '+' }, ---@diagnostic disable-line: missing-fields
change = { text = '~' }, ---@diagnostic disable-line: missing-fields
delete = { text = '_' }, ---@diagnostic disable-line: missing-fields
topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields
changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields
},
},
},
Expand All @@ -301,6 +304,9 @@ require('lazy').setup({
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
---@module 'which-key'
---@type wk.Opts
---@diagnostic disable-next-line: missing-fields
opts = {
-- delay between pressing a key and opening which-key (milliseconds)
-- this setting is independent of vim.o.timeoutlen
Expand Down Expand Up @@ -468,6 +474,9 @@ require('lazy').setup({
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
---@module 'lazydev'
---@type lazydev.Config
---@diagnostic disable-next-line: missing-fields
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
Expand All @@ -482,7 +491,13 @@ require('lazy').setup({
-- Automatically install LSPs and related tools to stdpath for Neovim
-- Mason must be loaded before its dependents so we need to set it up here.
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
{ 'mason-org/mason.nvim', opts = {} },
{
'mason-org/mason.nvim',
---@module 'mason.settings'
---@type MasonSettings
---@diagnostic disable-next-line: missing-fields
opts = {},
},
'mason-org/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',

Expand Down Expand Up @@ -750,6 +765,8 @@ require('lazy').setup({
desc = '[F]ormat buffer',
},
},
---@module 'conform'
---@type conform.setupOpts
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
Expand Down Expand Up @@ -810,8 +827,8 @@ require('lazy').setup({
},
'folke/lazydev.nvim',
},
--- @module 'blink.cmp'
--- @type blink.cmp.Config
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
-- 'default' (recommended) for mappings similar to built-in completions
Expand Down Expand Up @@ -899,7 +916,15 @@ require('lazy').setup({
},

-- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
{
'folke/todo-comments.nvim',
event = 'VimEnter',
dependencies = { 'nvim-lua/plenary.nvim' },
---@module 'todo-comments'
---@type TodoOptions
---@diagnostic disable-next-line: missing-fields
opts = { signs = false },
},

{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
Expand Down Expand Up @@ -943,6 +968,9 @@ require('lazy').setup({
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
---@module 'nvim-treesitter.configs'
---@type TSConfig
---@diagnostic disable-next-line: missing-fields
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
Expand Down Expand Up @@ -990,7 +1018,7 @@ require('lazy').setup({
-- Or use telescope!
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
-- you can continue same window with `<space>sr` which resumes last telescope search
}, {
}, { ---@diagnostic disable-line: missing-fields
ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
Expand Down
3 changes: 3 additions & 0 deletions lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information

---@module 'lazy'
---@type LazySpec
return {}
2 changes: 2 additions & 0 deletions lua/kickstart/plugins/autopairs.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- autopairs
-- https://github.com/windwp/nvim-autopairs

---@module 'lazy'
---@type LazySpec
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
Expand Down
4 changes: 4 additions & 0 deletions lua/kickstart/plugins/debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)

---@module 'lazy'
---@type LazySpec
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
Expand Down Expand Up @@ -100,11 +102,13 @@ return {

-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
---@diagnostic disable-next-line: missing-fields
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
---@diagnostic disable-next-line: missing-fields
controls = {
icons = {
pause = '⏸',
Expand Down
5 changes: 5 additions & 0 deletions lua/kickstart/plugins/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.

---@module 'lazy'
---@type LazySpec
return {
{
'lewis6991/gitsigns.nvim',
---@module 'gitsigns'
---@type Gitsigns.Config
---@diagnostic disable-next-line: missing-fields
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
Expand Down
4 changes: 4 additions & 0 deletions lua/kickstart/plugins/indent_line.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---@module 'lazy'
---@type LazySpec
return {
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
---@module 'ibl'
---@type ibl.config
opts = {},
},
}
2 changes: 2 additions & 0 deletions lua/kickstart/plugins/lint.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---@module 'lazy'
---@type LazySpec
return {

{ -- Linting
Expand Down
4 changes: 4 additions & 0 deletions lua/kickstart/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim

---@module 'lazy'
---@type LazySpec
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
Expand All @@ -13,6 +15,8 @@ return {
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
},
---@module 'neo-tree'
---@type neotree.Config
opts = {
filesystem = {
window = {
Expand Down