Changed the files to work with templates

This commit is contained in:
DarthMooMancer
2025-04-17 20:39:25 -04:00
parent a5c8a04e0f
commit 11ecd94afd
10 changed files with 352 additions and 348 deletions
-15
View File
@@ -21,21 +21,6 @@ function M.setup(opts)
end
end
function M.create_new_file()
vim.ui.input({ prompt = "Enter class name: " }, function(class_name)
if not class_name or class_name == "" then return print("Class creation canceled.") end
local root_dir = vim.fn.expand("%:p:h"):match("(.*)/src")
if not root_dir then return print("Error: src directory not found.") end
local java_content = string.format([[
public class %s {
// New File
}
]], class_name)
utils.write_file(root_dir .. "/src/" .. class_name .. ".java", java_content)
end)
end
function M.build()
local project_root = vim.fn.expand("%:p:h"):match("(.*)/src")
if not project_root then return print("Error: Could not detect project root directory.") end