aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/cmake/commands.lua68
-rw-r--r--lua/cmake/config.lua2
2 files changed, 67 insertions, 3 deletions
diff --git a/lua/cmake/commands.lua b/lua/cmake/commands.lua
index d763958..72fe4b9 100644
--- a/lua/cmake/commands.lua
+++ b/lua/cmake/commands.lua
@@ -1,5 +1,6 @@
local commandline = require("cmake.commandline")
local actions = require("cmake.actions")
+local project = require("cmake.project")
local M = {}
@@ -7,6 +8,72 @@ local cmd = vim.api.nvim_create_user_command
local prefix = "CMake"
+-- local _commands = {
+-- generate = {
+-- options = {
+-- fresh = {},
+-- },
+-- action = actions.generate,
+-- },
+-- build = {
+-- options = {
+-- target = {
+-- type = "table",
+-- subtype = "string",
+-- delimiter = ",",
+-- source = function()
+-- return vim.iter(project.current_targets())
+-- :map(function(target)
+-- return target.name
+-- end)
+-- :totable()
+-- end,
+-- },
+-- clean = {},
+-- j = { type = "number" },
+-- },
+-- action = actions.build,
+-- },
+-- select = {
+-- commands = {
+-- generate = {
+-- action = actions.generate_select,
+-- },
+-- build = {
+-- action = actions.build_select,
+-- },
+-- run = {
+-- action = actions.run_target_select,
+-- },
+-- },
+-- },
+-- explain = {
+-- commands = {
+-- generate = {
+-- action = actions.generate_select,
+-- },
+-- build = {
+-- action = actions.build_select,
+-- },
+-- },
+-- },
+-- run = {
+-- options = {}, -- any options are possible. passed to action as a single string
+-- action = actions.run_target,
+-- },
+-- edit = {
+-- commands = {
+-- variants = {
+-- action = actions.edit_variants,
+-- },
+-- -- settings = {},
+-- },
+-- },
+-- toggle = {
+-- action = actions.toggle,
+-- },
+-- }
+
local commands = {
["Generate"] = {
command = actions.generate,
@@ -54,7 +121,6 @@ local commands = {
command = actions.build_select,
cmd_opts = { desc = "Select build configuration" },
},
- -- ["Install"] = {},
["Run"] = {
command = actions.run_target,
cmd_opts = { desc = "Run current executable target", nargs = "*" },
diff --git a/lua/cmake/config.lua b/lua/cmake/config.lua
index 0392319..4bf49ba 100644
--- a/lua/cmake/config.lua
+++ b/lua/cmake/config.lua
@@ -4,7 +4,6 @@
---@field generate_after_save boolean Generate after saving `CMakeLists.txt` file
---@field cmake_terminal CMakeConfigCMakeTerminal Settings for terminal where cmake will be executed
---@field target_terminal CMakeConfigTargetTerminal Settings for terminal where executable targets will be executed
----@field disabled_commands string[] List of commands that will not be initialized
---@class CMakeConfigCMake
---@field cmake_path string Path to `cmake` executable
@@ -97,7 +96,6 @@ local default_config = {
long = { sep = " ❄ ", show = false },
},
keybinds = {},
- disable_commands = {},
}
local M = vim.deepcopy(default_config)