From e2bbf3deefc906b25de849c921a64061bdd600bd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 23 Dec 2022 08:34:55 +0100 Subject: [PATCH] refactor: better annotations to make sumneko faster --- lua/lazy/core/util.lua | 1 + lua/lazy/util.lua | 1 + lua/lazy/view/render.lua | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 3fe7f91..54b7148 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -1,3 +1,4 @@ +---@class LazyUtilCore local M = {} ---@alias LazyProfile {data: string|{[string]:string}, time: number, [number]:LazyProfile} diff --git a/lua/lazy/util.lua b/lua/lazy/util.lua index 0dbe496..a16feb5 100644 --- a/lua/lazy/util.lua +++ b/lua/lazy/util.lua @@ -1,3 +1,4 @@ +---@class LazyUtil: LazyUtilCore local M = setmetatable({}, { __index = require("lazy.core.util") }) function M.file_exists(file) diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index 4e2f781..29003ed 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -17,10 +17,12 @@ local Text = require("lazy.view.text") ---@field _diagnostics LazyDiagnostic[] ---@field plugin_range table ---@field _details? string -local M = setmetatable({}, { __index = Text }) +local M = {} +---@return Render function M.new(buf, win, padding, wrap) - local self = setmetatable({}, { __index = M }) + ---@type Render + local self = setmetatable({}, { __index = setmetatable(M, { __index = Text }) }) self.buf = buf self.win = win self.padding = padding or 0