diff --git a/lua/word/mod/integration/blink/init.lua b/lua/word/mod/integration/blink/init.lua index c9fcaf4..628ddda 100644 --- a/lua/word/mod/integration/blink/init.lua +++ b/lua/word/mod/integration/blink/init.lua @@ -1,7 +1,14 @@ -local M = Mod.create("integration.blink") +local mod = require("word.mod") + +---@type word.Mod +local M = mod.create("integration.blink") local has_blink, blink = pcall(require, "blink.cmp") +---@class word.integration.blink.Config +M.config.public = {} +---@class word.integration.blink.Data +M.data = {} M.data.source = require("word.mod.integration.blink.source") M.data.format = require("word.mod.integration.blink.format") diff --git a/lua/word/mod/integration/fzf/init.lua b/lua/word/mod/integration/fzf/init.lua index 39fdd1b..b54f67f 100644 --- a/lua/word/mod/integration/fzf/init.lua +++ b/lua/word/mod/integration/fzf/init.lua @@ -1,4 +1,6 @@ -local F = Mod.create("integration.fzf") +local mod = require("word.mod") +---@type word.Mod +local F = mod.create("integration.fzf") return F diff --git a/lua/word/mod/integration/lualine/init.lua b/lua/word/mod/integration/lualine/init.lua index 55c02fe..3ec98c1 100644 --- a/lua/word/mod/integration/lualine/init.lua +++ b/lua/word/mod/integration/lualine/init.lua @@ -1,4 +1,5 @@ ----@type word.mod -local L = Mod.create("integration.lualine") +local mod = require("word.mod") +---@type word.Mod +local L = mod.create("integration.lualine") return L diff --git a/lua/word/mod/integration/telescope/init.lua b/lua/word/mod/integration/telescope/init.lua index 6573eb4..103ad93 100644 --- a/lua/word/mod/integration/telescope/init.lua +++ b/lua/word/mod/integration/telescope/init.lua @@ -1,4 +1,5 @@ -local M = Mod.create("integration.telescope") +local mod = require("word.mod") +local M = mod.create("integration.telescope") local tok, t = pcall(require, "telescope") local k = vim.keymap.set @@ -11,29 +12,30 @@ M.setup = function() } else return { - loaded = false + loaded = false, } end end +---@class word.integration.telescope.Data M.data = { - picker_names = { - "linkable", - "files", - -- "insert_link", - -- "insert_file_link", - -- "search_headings", - -- "find_project_tasks", - -- "find_aof_project_tasks", - -- "find_aof_tasks", - -- "find_context_tasks", - "workspace", - -- "backlinks.file_backlinks", - -- "backlinks.header_backlinks", + picker_names = { + "linkable", + "files", + -- "insert_link", + -- "insert_file_link", + -- "search_headings", + -- "find_project_tasks", + -- "find_aof_project_tasks", + -- "find_aof_tasks", + -- "find_context_tasks", + "workspace", + -- "backlinks.file_backlinks", + -- "backlinks.header_backlinks", }, } -M.config.public = { -} +---@class word.integration.telescope.Config +M.config.public = {} M.data.pickers = function() local r = {} for _, pic in ipairs(M.data.picker_names) do @@ -47,45 +49,45 @@ M.data.pickers = function() end M.events.subscribed = { cmd = { - ["cmd.integration.telescope.find.files"] = true, - ["cmd.integration.telescope.find.workspace"] = true, + ["integration.telescope.find.files"] = true, + ["integration.telescope.find.workspace"] = true, }, } M.load = function() if tok then - Mod.await("cmd", function(cmd) - cmd.add_commands_from_table({ - find = { - args = 0, - name = "integration.telescope.find", - subcommands = { - files = { - name = "cmd.integration.telescope.find.files", - args = 0, - }, - workspace = { - name = "cmd.integration.telescope.find.workspace", - args = 0, + mod.await("cmd", function(cmd) + cmd.add_commands_from_table({ + find = { + args = 0, + name = "integration.telescope.find", + subcommands = { + files = { + name = "integration.telescope.find.files", + args = 0, + }, + workspace = { + name = "integration.telescope.find.workspace", + args = 0, + }, }, }, - }, - }) - end) - assert(tok, t) - t.load_extension("word") - for _, pic in ipairs(M.data.picker_names) do - -- t.load_extension(pic) - k("n", "word.telescope." .. pic .. "", M.data.pickers()[pic]) - end + }) + end) + assert(tok, t) + t.load_extension("word") + for _, pic in ipairs(M.data.picker_names) do + -- t.load_extension(pic) + k("n", "word.telescope." .. pic .. "", M.data.pickers()[pic]) + end else return end end M.on = function(event) - if event.type == "cmd.events.integration.telescope.find.files" then + if event.type == "integration.telescope.find.files" then vim.cmd([[Telescope word find_word]]) - elseif event.type == "cmd.events.integration.telescope.find.workspace" then + elseif event.type == "integration.telescope.find.workspace" then vim.cmd([[Telescope word workspace]]) require("telescope._extensions.word.picker.workspace")() end