fix lsp register ^& code runner config

This commit is contained in:
asep komarudin 2023-03-05 19:29:48 +07:00
parent 38d2c29a95
commit 418a659142
4 changed files with 29 additions and 12 deletions

View file

@ -2,18 +2,27 @@ local status_ok, code_runner = pcall(require, "code_runner")
if not status_ok then
return
end
local filetype = {
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
python = "python3 -u",
typescript = "deno run",
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
cpp = "g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
}
local data_exists, runscript = pcall(require, "core.config")
if data_exists then
for _, code in pairs(runscript.coderunner) do
table.insert(filetype, code)
end
end
code_runner.setup({
-- put here the commands by filetype
filetype = {
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
python = "python3 -u",
typescript = "deno run",
javascript = "node $dir/$fileName",
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
cpp = "g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
},
filetype = filetype,
-- mode = "term",
mode = "float",
focus = true,