REFACTOR: Annotations for autocompletion, reworked how projects are made

and handled, wrote the c file replacing the copied python code.
This commit is contained in:
2026-10-22 04:29:52 -04:00
parent 3bb97d833b
commit 685a711644
13 changed files with 373 additions and 178 deletions
+5 -5
View File
@@ -1,17 +1,17 @@
local M = {}
---@param path string Filetype of template
---@param kind_path string Filetype of template
---@param kind string Template in language table
---@param name string A string to replace temp values in template
---@return string
---@return string Content Formatted string
function M.fetch(kind_path, kind, name)
kind_path, kind, name = kind_path or "", kind or "", name or ""
if kind_path == "" or kind == "" or name == "" then
kind, name = kind or "", name or ""
if (kind == "" or nil) or (name == "" or nil) then
return ""
end
local ok, mod = pcall(require, kind_path)
if ok and type(mod) == "table" then
return (string.gsub(mod[kind], "%%s", name))
return (string.gsub(mod[kind], "__PROJECT_NAME__", name))
end
return ""
end