format all lua files

This commit is contained in:
2023-01-29 11:55:25 +01:00
parent fa0d4ffd8f
commit b87bbaee74
19 changed files with 179 additions and 453 deletions

View File

@@ -22,37 +22,37 @@ return {
vim.api.nvim_set_hl(
0,
"LspReferenceText",
'LspReferenceText',
{ bold = true,
ctermbg = 'red',
bg = "#5a524c" }
bg = '#5a524c' }
)
vim.api.nvim_set_hl(
0,
"LspReferenceRead",
'LspReferenceRead',
{ bold = true,
ctermbg = 'red',
bg = 'DarkGreen' }
)
vim.api.nvim_set_hl(
0,
"LspReferenceWrite",
'LspReferenceWrite',
{ bold = true,
ctermbg = 'red',
bg = 'DarkRed' }
)
local diagnostics = {
Error = "",
Warning = "",
Information = "",
Question = "",
Hint = "",
Error = '',
Warning = '',
Information = '',
Question = '',
Hint = '',
}
local signs = {
{ name = "DiagnosticSignError", text = diagnostics.Error },
{ name = "DiagnosticSignWarn", text = diagnostics.Warning },
{ name = "DiagnosticSignHint", text = diagnostics.Hint },
{ name = "DiagnosticSignInfo", text = diagnostics.Information },
{ name = 'DiagnosticSignError', text = diagnostics.Error },
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
}
for _, sign in ipairs(signs) do
@@ -129,22 +129,22 @@ return {
-- Set autocommands conditional on server_capabilities
if client.server_capabilities.documentHighlightProvider then
local group = vim.api.nvim_create_augroup("lsp_document_highlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
callback = function()
vim.lsp.buf.document_highlight()
end,
buffer = bufnr,
group = group,
desc = "Document Highlight",
desc = 'Document Highlight',
})
vim.api.nvim_create_autocmd("CursorMoved", {
vim.api.nvim_create_autocmd('CursorMoved', {
callback = function()
vim.lsp.buf.clear_references()
end,
buffer = bufnr,
group = group,
desc = "Clear All the References",
desc = 'Clear All the References',
})
vim.api.nvim_create_autocmd({ 'LspDetach' }, {
group = group,
@@ -185,8 +185,8 @@ return {
local clangd_capabilities = capabilities
clangd_capabilities.textDocument.semanticHighlighting = true
clangd_capabilities.offsetEncoding = { "utf-16" }
require("clangd_extensions").setup {
clangd_capabilities.offsetEncoding = { 'utf-16' }
require('clangd_extensions').setup {
server = {
capabilities = clangd_capabilities,
on_attach = on_attach,
@@ -211,13 +211,6 @@ return {
}
}
-- require('clangd_extensions').setup({
-- server = {
-- on_attach = on_attach,
-- capabilities = capabilities,
-- cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
-- },
-- })
lspconfig['jsonls'].setup {
capabilities = capabilities,
@@ -256,7 +249,7 @@ return {
defaultConfig = {
indent_style = 'space',
indent_size = '2',
quote_style = 'single'
quote_style = 'single',
}
}
},
@@ -300,10 +293,10 @@ return {
virtual_text = false,
signs = true,
float = {
border = "single",
border = 'single',
format = function(diagnostic)
return string.format(
"%s (%s) [%s]",
'%s (%s) [%s]',
diagnostic.message,
diagnostic.source,
diagnostic.code or diagnostic.user_data.lsp.code