Skip to content

Commit

Permalink
chore(languages): All options have been adapted to acomodate the new …
Browse files Browse the repository at this point in the history
…bau architecture.
  • Loading branch information
Zeioth committed Oct 30, 2023
1 parent 596c9d2 commit 260e87a
Show file tree
Hide file tree
Showing 22 changed files with 119 additions and 215 deletions.
11 changes: 4 additions & 7 deletions lua/compiler/languages/asm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program", value = "option1" },
{ text = "2 - Build program", value = "option2" },
{ text = "3 - Run program", value = "option3" },
{ text = "4 - Build solution", value = "option4" },
{ text = "5 - Run Makefile", value = "option5" }
{ text = "Build and run program", value = "option1" },
{ text = "Build program", value = "option2" },
{ text = "Run program", value = "option3" },
{ text = "Build solution", value = "option4" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -225,8 +224,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
end
elseif selected_option == "option5" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
11 changes: 4 additions & 7 deletions lua/compiler/languages/c.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program", value = "option1" },
{ text = "2 - Build program", value = "option2" },
{ text = "3 - Run program", value = "option3" },
{ text = "4 - Build solution", value = "option4" },
{ text = "5 - Run Makefile", value = "option5" }
{ text = "Build and run program", value = "option1" },
{ text = "Build program", value = "option2" },
{ text = "Run program", value = "option3" },
{ text = "Build solution", value = "option4" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -136,8 +135,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
end
elseif selected_option == "option5" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
11 changes: 4 additions & 7 deletions lua/compiler/languages/cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program", value = "option1" },
{ text = "2 - Build program", value = "option2" },
{ text = "3 - Run program", value = "option3" },
{ text = "4 - Build solution", value = "option4" },
{ text = "5 - Run Makefile", value = "option5" }
{ text = "Build and run program", value = "option1" },
{ text = "Build program", value = "option2" },
{ text = "Run program", value = "option3" },
{ text = "Build solution", value = "option4" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -135,8 +134,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
end
elseif selected_option == "option5" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
16 changes: 6 additions & 10 deletions lua/compiler/languages/cs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - build and run program (csc)", value = "option1" },
{ text = "2 - build program (csc)", value = "option2" },
{ text = "3 - run program (csc)", value = "option3" },
{ text = "4 - Build solution (csc)", value = "option4" },
{ text = "build and run program (csc)", value = "option1" },
{ text = "build program (csc)", value = "option2" },
{ text = "run program (csc)", value = "option3" },
{ text = "Build solution (csc)", value = "option4" },
{ text = "", value = "separator" },
{ text = "5 - Build and run program (dotnet)", value = "option5" },
{ text = "6 - Build program (dotnet)", value = "option6" },
{ text = "", value = "separator" },
{ text = "7 - Run Makefile", value = "option7" }
{ text = "Build and run program (dotnet)", value = "option5" },
{ text = "Build program (dotnet)", value = "option6" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -159,8 +157,6 @@ function M.action(selected_option)
},},},})
task:start()
vim.cmd("OverseerOpen")
elseif selected_option == "option7" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
42 changes: 13 additions & 29 deletions lua/compiler/languages/dart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Run this file (interpreted)", value = "option1" },
{ text = "2 - Run program (interpreted)", value = "option2" },
{ text = "3 - Build solution (interpreted)", value = "option3" },
{ text = "Run this file (interpreted)", value = "option1" },
{ text = "Run program (interpreted)", value = "option2" },
{ text = "Build solution (interpreted)", value = "option3" },
{ text = "", value = "separator" },
{ text = "4 - Build and run program (machine code)", value = "option4" },
{ text = "5 - Build program (machine code)", value = "option5" },
{ text = "6 - Run program (machine code)", value = "option6" },
{ text = "7 - Build solution (machine code)", value = "option7" },
{ text = "Build and run program (machine code)", value = "option4" },
{ text = "Build program (machine code)", value = "option5" },
{ text = "Run program (machine code)", value = "option6" },
{ text = "Build solution (machine code)", value = "option7" },
{ text = "", value = "separator" },
{ text = "8 - Run program (flutter)", value = "option8" },
{ text = "9 - Build for linux (flutter)", value = "option9" },
{ text = "10 - Build for android (flutter)", value = "option10" },
{ text = "11 - Build for ios (flutter)", value = "option11" },
{ text = "12 - Build for web (flutter)", value = "option12" },
{ text = "Run program (flutter)", value = "option8" },
{ text = "Build for linux (flutter)", value = "option9" },
{ text = "Build for android (flutter)", value = "option10" },
{ text = "Build for ios (flutter)", value = "option11" },
{ text = "Build for web (flutter)", value = "option12" },
{ text = "", value = "separator" },
{ text = "13 - Transpile program to javascript", value = "option13" },
{ text = "14 - Run Makefile", value = "option14" }
{ text = "Transpile program to javascript", value = "option13" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -327,21 +326,6 @@ function M.action(selected_option)
},},},})
task:start()
vim.cmd("OverseerOpen")












--=============================== MAKE ====================================--
elseif selected_option == "option14" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
9 changes: 3 additions & 6 deletions lua/compiler/languages/elixir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Run this file", value = "option1" },
{ text = "2 - Mix run", value = "option2" },
{ text = "3 - Run REPL", value = "option3" },
{ text = "4 - Run Makefile", value = "option4" }
{ text = "Run this file", value = "option1" },
{ text = "Mix run", value = "option2" },
{ text = "Run REPL", value = "option3" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -48,8 +47,6 @@ function M.action(selected_option)
},},},})
task:start()
vim.cmd("OverseerOpen")
elseif selected_option == "option4" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
9 changes: 3 additions & 6 deletions lua/compiler/languages/fsharp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program (dotnet)", value = "option1" },
{ text = "2 - Build program (dotnet)", value = "option2" },
{ text = "3 - Run REPL", value = "option3" },
{ text = "4 - Run Makefile", value = "option4" }
{ text = "Build and run program (dotnet)", value = "option1" },
{ text = "Build program (dotnet)", value = "option2" },
{ text = "Run REPL", value = "option3" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -46,8 +45,6 @@ function M.action(selected_option)
},},},})
task:start()
vim.cmd("OverseerOpen")
elseif selected_option == "option4" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
11 changes: 4 additions & 7 deletions lua/compiler/languages/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program", value = "option1" },
{ text = "2 - Build program", value = "option2" },
{ text = "3 - Run program", value = "option3" },
{ text = "4 - Build solution", value = "option4" },
{ text = "5 - Run Makefile", value = "option5" }
{ text = "Build and run program", value = "option1" },
{ text = "Build program", value = "option2" },
{ text = "Run program", value = "option3" },
{ text = "Build solution", value = "option4" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -136,8 +135,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
end
elseif selected_option == "option5" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
20 changes: 8 additions & 12 deletions lua/compiler/languages/java.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program (class)", value = "option1" },
{ text = "2 - Build progrm (class)", value = "option2" },
{ text = "3 - Run program (class)", value = "option3" },
{ text = "4 - Build solution (class)", value = "option4" },
{ text = "Build and run program (class)", value = "option1" },
{ text = "Build progrm (class)", value = "option2" },
{ text = "Run program (class)", value = "option3" },
{ text = "Build solution (class)", value = "option4" },
{ text = "", value = "separator" },
{ text = "5 - Build and run program (jar)", value = "option5" },
{ text = "6 - Build program (jar)", value = "option6" },
{ text = "7 - Run program (jar)", value = "option7" },
{ text = "8 - Build solution (jar)", value = "option8" },
{ text = "", value = "separator" },
{ text = "9 - Run Makefile", value = "option9" }
{ text = "Build and run program (jar)", value = "option5" },
{ text = "Build program (jar)", value = "option6" },
{ text = "Run program (jar)", value = "option7" },
{ text = "Build solution (jar)", value = "option8" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -270,8 +268,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
end
elseif selected_option == "option9" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
11 changes: 4 additions & 7 deletions lua/compiler/languages/javascript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Run this file", value = "option1" },
{ text = "2 - Run program", value = "option2" },
{ text = "3 - NPM install", value = "option3" },
{ text = "4 - NPM start", value = "option4" },
{ text = "5 - Run Makefile", value = "option5" }
{ text = "Run this file", value = "option1" },
{ text = "Run program", value = "option2" },
{ text = "NPM install", value = "option3" },
{ text = "NPM start", value = "option4" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -65,8 +64,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
vim.cmd("OverseerOpen")
elseif selected_option == "option5" then
require("compiler.languages.make").run_makefile() -- run
end

end
Expand Down
37 changes: 11 additions & 26 deletions lua/compiler/languages/kotlin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Build and run program (class)", value = "option1" },
{ text = "2 - Build program (class)", value = "option2" },
{ text = "3 - Run program (class)", value = "option3" },
{ text = "4 - Build solution (class)", value = "option4" },
{ text = "Build and run program (class)", value = "option1" },
{ text = "Build program (class)", value = "option2" },
{ text = "Run program (class)", value = "option3" },
{ text = "Build solution (class)", value = "option4" },
{ text = "", value = "separator" },
{ text = "5 - Build and run program (jar)", value = "option5" },
{ text = "6 - Build program (jar)", value = "option6" },
{ text = "7 - Run program (jar)", value = "option7" },
{ text = "8 - Build solution (jar)", value = "option8" },
{ text = "Build and run program (jar)", value = "option5" },
{ text = "Build program (jar)", value = "option6" },
{ text = "Run program (jar)", value = "option7" },
{ text = "Build solution (jar)", value = "option8" },
{ text = "", value = "separator" },
{ text = "9 - Run gradlew installDebug", value = "option9" },
{ text = "10 - Run gradlew build", value = "option10" },
{ text = "Run gradlew installDebug", value = "option9" },
{ text = "Run gradlew build", value = "option10" },
{ text = "", value = "separator" },
{ text = "11 - Run REPL", value = "option11" },
{ text = "12 - Run Makefile", value = "option12" }
{ text = "Run REPL", value = "option11" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -318,20 +317,6 @@ function M.action(selected_option)
},},},})
task:start()
vim.cmd("OverseerOpen")











--=============================== MAKE ====================================--
elseif selected_option == "option12" then
require("compiler.languages.make").run_makefile() -- run
end
end

Expand Down
9 changes: 3 additions & 6 deletions lua/compiler/languages/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Run this file", value = "option1" },
{ text = "2 - Run program", value = "option2" },
{ text = "3 - Run solution", value = "option3" },
{ text = "4 - Run Makefile", value = "option4" }
{ text = "Run this file", value = "option1" },
{ text = "Run program", value = "option2" },
{ text = "Run solution", value = "option3" }
}

--- Backend - overseer tasks performed on option selected
Expand Down Expand Up @@ -105,8 +104,6 @@ function M.action(selected_option)
task:start()
vim.cmd("OverseerOpen")
end
elseif selected_option == "option4" then
require("compiler.languages.make").run_makefile() -- run
end

end
Expand Down
14 changes: 11 additions & 3 deletions lua/compiler/languages/make.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ local M = {}

--- Frontend - options displayed on telescope
M.options = {
{ text = "1 - Run Makefile", value = "option1" }
{ text = "Run Makefile", value = "option1" }
}

--- Helper
-- Runs ./Makefile in the current working directory.
-- This prevents code repetition as this method is meant to be called by
-- all other languages to act as glue for border cases.
function M.run_makefile()
-- If no makefile, show a warning notification and return.
local stat = vim.loop.fs_stat("./Makefile")
if not stat then
vim.notify("You must have a Makefile in your working directory", vim.log.levels.WARN, {
title = "Compiler.nvim"
})
return
end

-- Run makefile
local utils = require("compiler.utils")
local overseer = require("overseer")
local makefile = utils.os_path(vim.fn.getcwd() .. "/Makefile")
Expand Down
Loading

0 comments on commit 260e87a

Please sign in to comment.