added cs
This commit is contained in:
parent
7386d8f53e
commit
636d8977b3
|
|
@ -209,5 +209,18 @@ return require("packer").startup(
|
||||||
"monokai.nvim"
|
"monokai.nvim"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
"andweeb/presence.nvim",
|
||||||
|
config = function()
|
||||||
|
require("presence"):setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
config = function()
|
||||||
|
require("plugins/dap")
|
||||||
|
end,
|
||||||
|
requires = {"mfussenegger/nvim-dap"}
|
||||||
|
}
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
-- dapui
|
||||||
|
require("dapui").setup()
|
||||||
|
local dap, dapui = require("dap"), require("dapui")
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- C#
|
||||||
|
dap.adapters.coreclr = {
|
||||||
|
type = "executable",
|
||||||
|
command = "netcoredbg",
|
||||||
|
args = {"--interpreter=vscode"}
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.cs = {
|
||||||
|
{
|
||||||
|
type = "coreclr",
|
||||||
|
name = "launch - netcoredbg",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
local cwd = vim.fn.getcwd()
|
||||||
|
local solution = vim.fn.glob(cwd .. "/*.csproj")
|
||||||
|
local projectName = vim.fn.fnamemodify(solution, ":t:r")
|
||||||
|
local proj = cwd .. "/bin/Debug/net6.0/" .. projectName .. ".dll"
|
||||||
|
print(proj)
|
||||||
|
return proj
|
||||||
|
-- return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- keybindings
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>db", ":lua require'dap'.toggle_breakpoint()<CR>", {noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>dc", ":lua require'dap'.continue()<CR>", {noremap = true, silent = true})
|
||||||
|
|
@ -68,3 +68,12 @@ augroup END
|
||||||
]],
|
]],
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
local formatGrp = vim.api.nvim_create_augroup("Format", {clear = true})
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
"BufWritePre",
|
||||||
|
{
|
||||||
|
pattern = "*.cs",
|
||||||
|
command = "lua vim.lsp.buf.format { async = false }",
|
||||||
|
group = formatGrp
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
require "lspconfig".jsonls.setup {
|
require "lspconfig".jsonls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|
@ -119,7 +119,7 @@ require "lspconfig".eslint.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
cmd = {"java-language-server"}
|
cmd = {"java-language-server"}
|
||||||
} ]]
|
} ]]
|
||||||
local servers = {"pyright", "bashls", "clangd", "cssls", "texlab", "prismals"}
|
local servers = {"pyright", "bashls", "clangd", "cssls", "texlab", "prismals", "csharp_ls"}
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
nvim_lsp[lsp].setup {
|
nvim_lsp[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue