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
+58 -31
View File
@@ -1,40 +1,67 @@
return {
c = {
root = "C",
-- source_root = "src/{project_name}",
keybinds = {
["<leader>pr"] = {
desc = "Executes c code",
action = require("vern.actions.c").run,
local M = {}
---@type VernLanguageConfig
M.c = {
root = "C",
dirs = {
src = "src",
include = "include/{project_name}",
},
keybinds = {
["<leader>pr"] = {
desc = "Executes c code",
action = require("vern.actions.c").run,
},
["<leader>pf"] = {
desc = "Creates source/header files",
action = require("vern.actions.c").create_file,
},
},
templates = {
project = {
primary = {
path = "{dirs.src}",
name = "main.c",
kind = "main",
kind_path = "vern.templates.c",
},
["<leader>px"] = {
desc = "Creates header files",
action = require("vern.actions.python").create_header,
manifest = {
path = ".",
name = "CMakeLists.txt",
kind = "CmakeLists",
kind_path = "vern.templates.c",
},
style = {
path = ".",
name = ".clang-format",
kind = "format",
kind_path = "vern.templates.c",
},
},
templates = {
project = {
bin = {
target = "src/{project_name}/main.py",
},
pkg = {
target = "src/{project_name}/__init__.py",
},
cfg = {
target = "pyproject.toml",
},
file = {
header = {
path = "{dirs.include}",
name = "{name}.h",
kind = "header",
kind_path = "vern.templates.c",
},
file = {
mod = {
target = "src/{project_name}/{name}.py",
},
source = {
path = "{dirs.src}",
name = "{name}.c",
kind = "source",
kind_path = "vern.templates.c",
},
extras = {
gitignore = {
template = "vern.templates.extras.gitignore", --- needs to call the function in file
target = ".gitignore",
},
},
extras = {
linter = {
path = ".",
name = ".clang-tidy",
kind = "linter",
kind_path = "vern.templates.c",
enabled = false,
},
},
},
}
return M