| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- return {
- {
- "neovim/nvim-lspconfig",
- enabled = true,
- lazy = false,
- config = function(_, _)
- -- Configuration on attach
- vim.api.nvim_create_autocmd("LspAttach", {
- group = vim.api.nvim_create_augroup("UserLspConfig", {}),
- callback = function(args)
- if vim.treesitter ~= nil and type(vim.treesitter.highlighter.active[args.buf]) ~= "nil" then
- local client = vim.lsp.get_client_by_id(args.data
- .client_id)
- client.server_capabilities.semanticTokensProvider = nil
- end
- vim.keymap.set("n", "SR", vim.lsp.buf.rename)
- vim.keymap.set("n", "Sx", vim.lsp.buf.code_action)
- vim.keymap.set("n", "SI", function()
- local diagnostic_config = vim.diagnostic.config()
- if (vim.lsp.inlay_hint.is_enabled()) then
- vim.lsp.inlay_hint.enable(false)
- vim.diagnostic.config({
- virtual_lines = {
- current_line = true,
- format = diagnostic_config.format
- }
- })
- else
- vim.lsp.inlay_hint.enable(true)
- vim.diagnostic.config({
- virtual_lines = true,
- format = diagnostic_config.format
- })
- end
- end)
- vim.keymap.set("n", "<Space>", vim.lsp.buf.hover)
- end
- })
- end
- }
- }
|