Skip to content

Commit 037f7eb

Browse files
committed
feat(C# .net) .csproj projects can compile & run.
1 parent f120eb2 commit 037f7eb

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
**/bin/
2+
**/obj/

lua/compiler/languages/cs.lua

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ M.options = {
88
{ text = "2 - Build program", value = "option2" },
99
{ text = "3 - Run program", value = "option3" },
1010
{ text = "4 - Build solution", value = "option4" },
11-
{ text = "5 - Run Makefile", value = "option5" }
11+
{ text = "", value = "separator" },
12+
{ text = "5 - Build and run dotnet", value = "option5" },
13+
{ text = "6 - Build dotnet", value = "option6" },
14+
{ text = "", value = "separator" },
15+
{ text = "7 - Run Makefile", value = "option7" }
1216
}
1317

1418
--- Backend - overseer tasks performed on option selected
@@ -136,6 +140,28 @@ function M.action(selected_option)
136140
vim.cmd("OverseerOpen")
137141
end
138142
elseif selected_option == "option5" then
143+
local task = overseer.new_task({
144+
name = "- C compiler",
145+
strategy = { "orchestrator",
146+
tasks = {{ "shell", name = "- Build & run .net project → .cproj",
147+
cmd = "dotnet run" .. -- compile and run
148+
" && echo " .. entry_point .. -- echo
149+
" && echo '" .. final_message .. "'"
150+
},},},})
151+
task:start()
152+
vim.cmd("OverseerOpen")
153+
elseif selected_option == "option6" then
154+
local task = overseer.new_task({
155+
name = "- C compiler",
156+
strategy = { "orchestrator",
157+
tasks = {{ "shell", name = "- Build .net project → .csproj",
158+
cmd = "dotnet build" .. -- compile
159+
" && echo " .. entry_point .. -- echo
160+
" && echo '" .. final_message .. "'"
161+
},},},})
162+
task:start()
163+
vim.cmd("OverseerOpen")
164+
elseif selected_option == "option7" then
139165
require("compiler.languages.make").run_makefile() -- run
140166
end
141167
end

0 commit comments

Comments
 (0)